-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #422 from DomCR/dedicated-boundingbox-tests
Dedicated boundingbox tests
- Loading branch information
Showing
23 changed files
with
402 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using ACadSharp.Entities; | ||
using CSMath; | ||
using Xunit; | ||
|
||
namespace ACadSharp.Tests.Entities | ||
{ | ||
public class CircleTests | ||
{ | ||
[Fact] | ||
public void GetBoundingBoxTest() | ||
{ | ||
Circle circle = new Circle(); | ||
circle.Radius = 5; | ||
|
||
BoundingBox boundingBox = circle.GetBoundingBox(); | ||
|
||
Assert.Equal(new XYZ(-5, -5, 0), boundingBox.Min); | ||
Assert.Equal(new XYZ(5, 5, 0), boundingBox.Max); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using ACadSharp.Entities; | ||
using CSMath; | ||
using System; | ||
using Xunit; | ||
|
||
namespace ACadSharp.Tests.Entities | ||
{ | ||
public class EllipseTests | ||
{ | ||
[Fact] | ||
public void GetBoundingBoxTest() | ||
{ | ||
//Ellipse size: x = 1, y = 0.5 | ||
Ellipse ellipse = new(); | ||
ellipse.RadiusRatio = 0.5d; | ||
|
||
BoundingBox boundingBox = ellipse.GetBoundingBox(); | ||
|
||
Assert.Equal(new XYZ(-1, -0.5, 0), boundingBox.Min); | ||
Assert.Equal(new XYZ(1, 0.5, 0), boundingBox.Max); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using ACadSharp.Entities; | ||
using CSMath; | ||
using Xunit; | ||
|
||
namespace ACadSharp.Tests.Entities | ||
{ | ||
public class LineTests | ||
{ | ||
[Fact] | ||
public void GetBoundingBoxTest() | ||
{ | ||
Line line = new Line(); | ||
line.EndPoint = new XYZ(10, 10, 0); | ||
|
||
BoundingBox boundingBox = line.GetBoundingBox(); | ||
|
||
Assert.Equal(new XYZ(0, 0, 0), boundingBox.Min); | ||
Assert.Equal(new XYZ(10, 10, 0), boundingBox.Max); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.