refactor: merge DxfImporter and DxfExporter into single static Dxf class
Consolidated two stateless classes into one unified API: Dxf.Import(), Dxf.GetGeometry(), Dxf.ExportPlate(), Dxf.ExportProgram(). Export state moved into a private ExportContext. Removed bool+out pattern from GetGeometry in favor of returning empty list on failure. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,17 +11,14 @@ public class DxfRoundtripTests
|
||||
private static List<Entity> ExportAndReimport(List<Entity> geometry)
|
||||
{
|
||||
var program = ConvertGeometry.ToProgram(geometry);
|
||||
var exporter = new DxfExporter();
|
||||
var importer = new DxfImporter();
|
||||
|
||||
using var exportStream = new MemoryStream();
|
||||
exporter.ExportProgram(program, exportStream);
|
||||
Dxf.ExportProgram(program, exportStream);
|
||||
var bytes = exportStream.ToArray();
|
||||
|
||||
var importStream = new MemoryStream(bytes);
|
||||
var success = importer.GetGeometry(importStream, out var reimported);
|
||||
var reimported = Dxf.GetGeometry(importStream);
|
||||
|
||||
Assert.True(success, "Failed to re-import exported DXF");
|
||||
Assert.NotEmpty(reimported);
|
||||
return reimported;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user