Files
OpenNest/OpenNest.Tests/CuttingStrategy/LeadInTestHelpers.cs
T
ajandClaude Opus 5.5 1d310b373e test(cutting): share the lead-in tests' point and profile helpers
Three lead-in test classes kept identical AssertPoint and Profile
helpers. They now import LeadInTestHelpers.

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

21 lines
757 B
C#

using OpenNest.CNC;
using OpenNest.CNC.CuttingStrategy;
using OpenNest.Geometry;
namespace OpenNest.Tests.CuttingStrategy;
/// <summary>Helpers the lead-in tests share. Import with <c>using static</c>.</summary>
internal static class LeadInTestHelpers
{
/// <summary>Asserts both coordinates match to 8 decimal places.</summary>
public static void AssertPoint(Vector expected, Vector actual)
{
Assert.Equal(expected.X, actual.X, 8);
Assert.Equal(expected.Y, actual.Y, 8);
}
/// <summary>The part's shape profile, leaving out rapid, scribe and break layers.</summary>
public static ShapeProfile Profile(Part part) => new(part.Program.ToGeometry()
.Where(e => SpecialLayers.IsMaterial(e.Layer)).ToList());
}