mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-15 17:05:33 -05:00
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>
29 lines
932 B
C#
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;
|
|
}
|
|
}
|
|
}
|