Files
OpenNest/OpenNest.WinForms.Tests/TestPrograms.cs
T
ajandClaude Opus 5.5 e5d9e12df9 test(desktop): share the square and rectangle part programs
Ten desktop test classes drew the same squares and the same 4 x 2
rectangle in private helpers, in two equivalent styles. They now use
TestPrograms.Square, ClockwiseSquare and Rectangle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 10:53:24 -05:00

35 lines
1.1 KiB
C#

using OpenNest.CNC;
namespace OpenNest.WinForms.Tests;
/// <summary>Part programs the desktop tests share.</summary>
internal static class TestPrograms
{
/// <summary>A width x height rectangle from the origin, counterclockwise: +X first.</summary>
public static Program Rectangle(double width, double height)
{
var program = new Program();
program.MoveTo(0, 0);
program.LineTo(width, 0);
program.LineTo(width, height);
program.LineTo(0, height);
program.LineTo(0, 0);
return program;
}
/// <summary>A size x size square from the origin, counterclockwise: +X first.</summary>
public static Program Square(double size) => Rectangle(size, size);
/// <summary>A size x size square from the origin, clockwise: up first.</summary>
public static Program ClockwiseSquare(double size)
{
var program = new Program();
program.MoveTo(0, 0);
program.LineTo(0, size);
program.LineTo(size, size);
program.LineTo(size, 0);
program.LineTo(0, 0);
return program;
}
}