Files
OpenNest/OpenNest.Desktop.Tests/Interaction/SelectionStatusTests.cs
T
ajandClaude Opus 5.5 313b5f57d6 feat(desktop): add a toolkit-neutral plate tool and selection model
PlateToolManager keeps one active tool with the WinForms action rules
(Escape cancels, then returns to Select, then resumes the ended tool) and
status text. SelectTool selects by click, Ctrl+click and window
(contains/intersect), takes common-line groups together and picks
cut-offs by their strokes. PlateHitTester hit-tests the shared display
geometry; PlateSelection reads and sets by part index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 19:30:47 -05:00

29 lines
932 B
C#

using System.Globalization;
using OpenNest.Desktop.Interaction;
namespace OpenNest.Desktop.Tests.Interaction;
public class SelectionStatusTests
{
[Fact]
public void One_part_shows_its_box_and_several_show_their_count_and_combined_box()
{
var previous = CultureInfo.CurrentCulture;
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
try
{
var plate = InteractionFixtures.Plate();
Assert.Equal(string.Empty, SelectionStatus.Text(Array.Empty<Part>()));
Assert.Equal("Selected: [20.0000, 0.0000] 10.0000 x 10.0000",
SelectionStatus.Text(new[] { plate.Parts[1] }));
Assert.Equal("Selected (2): [20.0000, 0.0000] 30.0000 x 10.0000",
SelectionStatus.Text(new[] { plate.Parts[1], plate.Parts[4] }));
}
finally
{
CultureInfo.CurrentCulture = previous;
}
}
}