mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-27 22:01:07 -04:00
The assigned machine now drives the support grid, lead-ins and cut-offs, so it should be visible without opening a menu. The status bar shows "Machine: <name>" beside the material; left- or right-clicking it lists the machines (the same list as Nest > Machine) above the label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.3 KiB
C#
35 lines
1.3 KiB
C#
using System.Globalization;
|
|
using OpenNest.Forms;
|
|
|
|
namespace OpenNest.WinForms.Tests.Forms;
|
|
|
|
public class MainStatusBarTests
|
|
{
|
|
[Fact]
|
|
public void FormatMaterial_ShowsNameAndThicknessWithUnits()
|
|
{
|
|
var previous = CultureInfo.CurrentCulture;
|
|
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
|
|
try
|
|
{
|
|
Assert.Equal("Material: A36 · 0.25 in", MainStatusBar.FormatMaterial("A36", 0.25, Units.Inches));
|
|
Assert.Equal("Material: 304 SS · 3 mm", MainStatusBar.FormatMaterial(" 304 SS ", 3, Units.Millimeters));
|
|
Assert.Equal("Material: A36", MainStatusBar.FormatMaterial("A36", 0, Units.Inches));
|
|
Assert.Equal("Material: 0.1875 in", MainStatusBar.FormatMaterial(null, 0.1875, Units.Inches));
|
|
Assert.Equal("Material: (none)", MainStatusBar.FormatMaterial("", 0, Units.Inches));
|
|
}
|
|
finally
|
|
{
|
|
CultureInfo.CurrentCulture = previous;
|
|
}
|
|
}
|
|
|
|
[Fact]
|
|
public void FormatMachine_ShowsTheNestsMachine()
|
|
{
|
|
Assert.Equal("Machine: CL-980", MainStatusBar.FormatMachine(new NestMachine(Guid.NewGuid(), " CL-980 ")));
|
|
Assert.Equal("Machine: (unnamed)", MainStatusBar.FormatMachine(new NestMachine(Guid.NewGuid(), "")));
|
|
Assert.Equal("Machine: (none)", MainStatusBar.FormatMachine(null));
|
|
}
|
|
}
|