mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-02 13:41:37 -05:00
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>
35 lines
1.1 KiB
C#
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;
|
|
}
|
|
}
|