This PR adds unit test framework and NET6 targeting.
In the first unit test inserted I test for Arc StartAngle, EndAngle and with the given dxf Polyline2DTest_0001.dxf results that test fails.
how test values given
If you try to explode the polyline in the dxf youll'notice that start point is marked with red and end point is marked with blue ( I used qcad ) ; aside there is Start Angle and End Angle values that I copied into the unit test ( mine qcad set with 8 decimals so testing tol=1e-8 ).
the test expects StartAngle ~= 214 while EndAngle ~= 210 for the first arc coming from the lwp explosion ( the one selected in the first sshoot ) ; this is because the order of polyline vertexes is following
then the polyline explosion generates LINE , ARC , LINE , ARC , LINE , ARC , LINE , ARC
where the first ARC requires that StartAngle is ~214 and EndAngle ~210 so this implies that StartAngle isn't necessary less than EndAngle in general.
unit tests
I hope youll'find the unit test system somewhat useful, personally I can't work without, they help me to double check automatically every function I wrote and they are really helpful for any refactoring because what is already written will ever need to satisfy conditions imposed by test and when you run dotnet test youll'see if something doesn't fit any more with what previously stated as correct.
In other words unit test acts like a barrier for errors ( of course the test need to be constructed as a valid check ).
This PR adds unit test framework and NET6 targeting. In the first unit test inserted I test for Arc StartAngle, EndAngle and with the given dxf Polyline2DTest_0001.dxf results that test fails.
how test values given
If you try to explode the polyline in the dxf youll'notice that start point is marked with red and end point is marked with blue ( I used qcad ) ; aside there is Start Angle and End Angle values that I copied into the unit test ( mine qcad set with 8 decimals so testing tol=1e-8 ).
how to run test
dotnet test
why test fails
the test expects StartAngle ~= 214 while EndAngle ~= 210 for the first arc coming from the lwp explosion ( the one selected in the first sshoot ) ; this is because the order of polyline vertexes is following
then the polyline explosion generates LINE , ARC , LINE , ARC , LINE , ARC , LINE , ARC where the first ARC requires that StartAngle is ~214 and EndAngle ~210 so this implies that StartAngle isn't necessary less than EndAngle in general.
unit tests
I hope youll'find the unit test system somewhat useful, personally I can't work without, they help me to double check automatically every function I wrote and they are really helpful for any refactoring because what is already written will ever need to satisfy conditions imposed by test and when you run
dotnet test
youll'see if something doesn't fit any more with what previously stated as correct. In other words unit test acts like a barrier for errors ( of course the test need to be constructed as a valid check ).