mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-15 23:55:37 -05:00
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.
37 lines
887 B
C#
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));
|
|
}
|
|
}
|