mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-15 15:09:29 +00:00
Add Edge Test for Polygon.Contains (#871)
* Added Assert for edge contains Reference: https://github.com/craftworkgames/MonoGame.Extended/issues/214 * Renamed to PolygonTests
This commit is contained in:
committed by
GitHub
parent
49038f5d42
commit
89c8984079
+6
-1
@@ -4,7 +4,7 @@ using Xunit;
|
||||
|
||||
namespace MonoGame.Extended.Tests.Shapes
|
||||
{
|
||||
public class PolygonFTests
|
||||
public class PolygonTests
|
||||
{
|
||||
[Fact]
|
||||
public void Polygon_Contains_Point_Test()
|
||||
@@ -24,6 +24,11 @@ namespace MonoGame.Extended.Tests.Shapes
|
||||
Assert.True(polygon.Contains(new Vector2(9.99f, 9.99f)));
|
||||
Assert.False(polygon.Contains(new Vector2(-1f, -1f)));
|
||||
Assert.False(polygon.Contains(new Vector2(-11f, -11f)));
|
||||
|
||||
// Reference: https://github.com/craftworkgames/MonoGame.Extended/issues/214
|
||||
// To maintain consistency with behavior in MonoGame, a point that exists at the edge of a polygon is
|
||||
// -not- contained within the polygon and should return false
|
||||
Assert.False(polygon.Contains(new Vector2(10.0f, 10.0f)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
Reference in New Issue
Block a user