Files
OpenNest/OpenNest.WinForms.Tests/Controls/PlateViewFillTimeTests.cs
T
ajandClaude Opus 5.5 763e2a1d4a fix(ui): scale the fill time in the status bar
Long fills read as thousands of milliseconds. Keep milliseconds under
a second, then show seconds and minutes so the time stays readable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 23:42:25 -05:00

19 lines
576 B
C#

using OpenNest.Controls;
namespace OpenNest.WinForms.Tests.Controls;
public class PlateViewFillTimeTests
{
[Theory]
[InlineData(0, "0 ms")]
[InlineData(850, "850 ms")]
[InlineData(999, "999 ms")]
[InlineData(1000, "1.0 s")]
[InlineData(2400, "2.4 s")]
[InlineData(59960, "59.9 s")]
[InlineData(60000, "1m 00s")]
[InlineData(125000, "2m 05s")]
public void FillTimeIsShownInTheLargestUnitThatFits(int milliseconds, string expected) =>
Assert.Equal(expected, PlateView.FormatFillTime(TimeSpan.FromMilliseconds(milliseconds)));
}