initial commit

This commit is contained in:
2026-05-02 01:01:15 +02:00
parent 591399495c
commit fc73ff47ff
945 changed files with 11285 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
using TraceCad.Core.Geometry;
using TraceCad.Core.Model;
using TraceCad.Dxf;
using Xunit;
namespace TraceCad.Tests;
public sealed class DxfExporterTests
{
[Fact]
public void ExportCreatesDxfFile()
{
var document = SketchDocument.CreateDefault();
document.AddEntity(new LineEntity(Guid.NewGuid(), Layer.Cut.Name, new Point2(0, 0), new Point2(100, 0)));
document.AddEntity(new CircleEntity(Guid.NewGuid(), Layer.Cut.Name, new Point2(20, 20), 10));
document.AddEntity(new ArcEntity(Guid.NewGuid(), Layer.Cut.Name, new Point2(40, 40), 12, 0, 180, false));
var path = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid():N}.dxf");
try
{
new NetDxfExporter().Export(document, path);
Assert.True(File.Exists(path));
Assert.True(new FileInfo(path).Length > 0);
Assert.Contains("SECTION", File.ReadAllText(path));
}
finally
{
if (File.Exists(path))
{
File.Delete(path);
}
}
}
}