mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-03 02:21:35 -05:00
test(desktop): apply the Edit Plate dialog directly in the outline tests
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
c21b5b006e
commit
a0d063bb94
2 files changed
+8
-5
No files matched your search
@@ -20,7 +20,6 @@ public class EditPlateFormOutlineTests
|
||||
using var form = new EditPlateForm(plate);
|
||||
var size = (TextBox)form.Controls.Find("textBoxSize", true)[0];
|
||||
var clear = (Button)form.Controls.Find("buttonClearOutline", true)[0];
|
||||
var done = (Button)form.Controls.Find("applyButton", true)[0];
|
||||
Assert.False(size.ReadOnly);
|
||||
Assert.False(clear.Enabled);
|
||||
|
||||
@@ -30,9 +29,9 @@ public class EditPlateFormOutlineTests
|
||||
Assert.True(clear.Enabled);
|
||||
Assert.Equal(new Size(48, 96).ToString(), form.SizeString);
|
||||
Assert.Contains("6 vertices", ((Label)form.Controls.Find("labelOutline", true)[0]).Text);
|
||||
Assert.True(done.Enabled);
|
||||
Assert.True(((Button)form.Controls.Find("applyButton", true)[0]).Enabled);
|
||||
|
||||
done.PerformClick();
|
||||
form.Apply();
|
||||
Assert.Equal(Ell(), plate.Outline);
|
||||
Assert.Equal(48, plate.Size.Width);
|
||||
Assert.Equal(96, plate.Size.Length);
|
||||
@@ -46,9 +45,10 @@ public class EditPlateFormOutlineTests
|
||||
var size = (TextBox)form.Controls.Find("textBoxSize", true)[0];
|
||||
Assert.True(size.ReadOnly);
|
||||
|
||||
((Button)form.Controls.Find("buttonClearOutline", true)[0]).PerformClick();
|
||||
form.Outline = null; // what Clear does
|
||||
Assert.False(size.ReadOnly);
|
||||
((Button)form.Controls.Find("applyButton", true)[0]).PerformClick();
|
||||
Assert.False(((Button)form.Controls.Find("buttonClearOutline", true)[0]).Enabled);
|
||||
form.Apply();
|
||||
|
||||
Assert.Null(plate.Outline);
|
||||
Assert.Equal(48, plate.Size.Width);
|
||||
|
||||
@@ -186,6 +186,9 @@ namespace OpenNest.Forms
|
||||
Outline = plate.Outline;
|
||||
}
|
||||
|
||||
/// <summary>Writes the dialog's values to the plate, as Done does.</summary>
|
||||
internal void Apply() => Save();
|
||||
|
||||
private void Save()
|
||||
{
|
||||
// The outline carries its own size; a parsed size would drop it.
|
||||
|
||||
Reference in new issue
Block a user