test: add ProgramReader tests validating CincyLib port

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-18 06:27:12 -05:00
parent 2bef75f548
commit 28c9f715be
4 changed files with 686 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
using FabWorks.Core.PressBrake;
using Xunit;
namespace FabWorks.Tests.PressBrake
{
public class ProgramReaderTests
{
[Fact]
public void Load_SamplePgm_ParsesProgramAttributes()
{
var pgm = Program.Load("TestData/sample.pgm");
// ProgName may be empty on some exports; verify PartName was parsed instead
Assert.False(string.IsNullOrEmpty(pgm.PartName));
}
[Fact]
public void Load_SamplePgm_ParsesThickness()
{
var pgm = Program.Load("TestData/sample.pgm");
Assert.True(pgm.MatThick > 0);
}
[Fact]
public void Load_SamplePgm_ParsesSteps()
{
var pgm = Program.Load("TestData/sample.pgm");
Assert.NotEmpty(pgm.Steps);
}
[Fact]
public void Load_SamplePgm_ParsesToolSetups()
{
var pgm = Program.Load("TestData/sample.pgm");
Assert.NotEmpty(pgm.UpperToolSets);
Assert.NotEmpty(pgm.LowerToolSets);
}
[Fact]
public void Load_SamplePgm_ResolvesStepToolReferences()
{
var pgm = Program.Load("TestData/sample.pgm");
var step = pgm.Steps[0];
Assert.NotNull(step.UpperTool);
Assert.NotNull(step.LowerTool);
}
}
}