update
This commit is contained in:
@@ -33,4 +33,29 @@ public sealed class DxfExporterTests
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExportRejectsInvalidDrawing()
|
||||
{
|
||||
var document = SketchDocument.CreateDefault();
|
||||
document.AddEntity(new LineEntity(Guid.NewGuid(), Layer.Cut.Name, new Point2(5, 5), new Point2(5, 5)));
|
||||
|
||||
var path = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid():N}.dxf");
|
||||
|
||||
try
|
||||
{
|
||||
var exception = Assert.Throws<InvalidOperationException>(() =>
|
||||
new NetDxfExporter().Export(document, path));
|
||||
|
||||
Assert.Contains("Cannot export invalid drawing", exception.Message);
|
||||
Assert.False(File.Exists(path));
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (File.Exists(path))
|
||||
{
|
||||
File.Delete(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user