Files
OpenNest/OpenNest.Desktop.Tests/Undo/NestFingerprintTests.cs
T
aj 38de7ab3a3 refactor(desktop): move Document and undo recording into OpenNest.Desktop
Document and Undo/ (ChangeScope, NestFingerprint, NestUndoState) use
only Core, Data, IO and Engine, so they move into the toolkit-neutral
library both desktop front ends share. Namespaces are unchanged, so the
WinForms app compiles as before; it keeps using the internal scope
factories and fingerprint through InternalsVisibleTo.

The scope, fingerprint and SaveAs/save-point rules now have Linux tests
in OpenNest.Desktop.Tests; before, only the Windows-only WinForms suite
covered them.
2026-10-29 18:40:49 -04:00

37 lines
887 B
C#

using OpenNest.Undo;
namespace OpenNest.Desktop.Tests.Undo;
public class NestFingerprintTests
{
[Fact]
public void UnchangedNest_KeepsItsFingerprint()
{
var nest = TestNests.OneSquare();
Assert.Equal(NestFingerprint.Compute(nest), NestFingerprint.Compute(nest));
}
[Fact]
public void MovingAPart_ChangesTheFingerprint()
{
var nest = TestNests.OneSquare();
var before = NestFingerprint.Compute(nest);
nest.Plates[0].Parts[0].Offset(1, 0);
Assert.NotEqual(before, NestFingerprint.Compute(nest));
}
[Fact]
public void ChangingARequiredQuantity_ChangesTheFingerprint()
{
var nest = TestNests.OneSquare();
var before = NestFingerprint.Compute(nest);
nest.Drawings.First().Quantity.Required = 5;
Assert.NotEqual(before, NestFingerprint.Compute(nest));
}
}