All 132 OpenNest.Engine source files now declare namespaces matching their nested directories: Jobs/, Jobs/Placement/, Jobs/Adapters/, Fill/, RectanglePacking/, CirclePacking/, and engine-root types moved from 'OpenNest' to 'OpenNest.Engine'. RootNamespace updated accordingly. Consumers (Api, Console, Mcp, Benchmark, Training, desktop app, tests) gained the explicit usings the move requires; CLAUDE.md updated.
57 lines
1.5 KiB
C#
57 lines
1.5 KiB
C#
using Xunit;
|
|
using OpenNest.Engine.Jobs;
|
|
|
|
namespace OpenNest.Engine.Tests.Jobs;
|
|
|
|
public class NestingEngineRegistryTests
|
|
{
|
|
[Fact]
|
|
public void BuiltInStrategiesAreRegistered()
|
|
{
|
|
var names = NestingEngineRegistry.AvailableEngines.Select(e => e.Name).ToList();
|
|
|
|
Assert.Contains("Default", names);
|
|
Assert.Contains("Strip", names);
|
|
Assert.Contains("Vertical Remnant", names);
|
|
Assert.Contains("Horizontal Remnant", names);
|
|
}
|
|
|
|
[Fact]
|
|
public void EachBuiltInFactoryProducesAWorkingEngine()
|
|
{
|
|
foreach (var info in NestingEngineRegistry.AvailableEngines)
|
|
{
|
|
var engine = info.Factory();
|
|
var result = engine.Solve(FiniteStockJobTests.Job(1));
|
|
|
|
Assert.Equal(NestJobStatus.Complete, result.Status);
|
|
}
|
|
}
|
|
|
|
[Fact]
|
|
public void DuplicateNameIsSkipped()
|
|
{
|
|
var before = NestingEngineRegistry.AvailableEngines.Count;
|
|
|
|
NestingEngineRegistry.Register(
|
|
"Default",
|
|
"duplicate",
|
|
() => new FixedStrategyNestingEngine("Default")
|
|
);
|
|
|
|
Assert.Equal(before, NestingEngineRegistry.AvailableEngines.Count);
|
|
}
|
|
|
|
[Fact]
|
|
public void LoadPluginsAgainstMissingDirectoryIsANoOp()
|
|
{
|
|
var before = NestingEngineRegistry.AvailableEngines.Count;
|
|
|
|
NestingEngineRegistry.LoadPlugins(
|
|
Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString())
|
|
);
|
|
|
|
Assert.Equal(before, NestingEngineRegistry.AvailableEngines.Count);
|
|
}
|
|
}
|