diff --git a/OpenNest.WinForms.Tests/Forms/CuttingInspectionPanelTests.cs b/OpenNest.WinForms.Tests/Forms/CuttingInspectionPanelTests.cs index 9a475422..e8a57986 100644 --- a/OpenNest.WinForms.Tests/Forms/CuttingInspectionPanelTests.cs +++ b/OpenNest.WinForms.Tests/Forms/CuttingInspectionPanelTests.cs @@ -187,6 +187,88 @@ public class CuttingInspectionPanelTests Assert.Same(original, editor.PlateView.Plate); }); + [Fact] + public void ScopeSelectorReplansForAllPlatesAndBackAndRemembersTheChoice() => RunSta(() => + { + using var editor = TwoPlateEditor(); + editor.Show(); + editor.PlateManager.LoadAt(0); + editor.OpenCuttingInspection(); + var panel = editor.CuttingInspection!; + var remembered = new List(); + panel.RememberScope = remembered.Add; + PumpUntil(() => panel.Proposal != null && !panel.IsPlanning); + var scope = Field(panel, "scopeSelector"); + Assert.True(scope.Visible); + Assert.Equal(0, scope.SelectedIndex); + Assert.Equal("All plates (2)", scope.Items[1]); + Assert.Single(panel.Proposal.Plates); + + scope.SelectedIndex = 1; + PumpUntil(() => panel.Proposal != null && !panel.IsPlanning); + Assert.True(panel.AllPlates); + Assert.Equal(2, panel.Proposal.Plates.Count); + Assert.True(Field