Files
MonoGame.Extended/Source/Tests/MonoGame.Extended.Tests/Primitives/EllipseFTest.cs
T
Lucas Girouard-StranksandDylan Wilson a1f8566a46 Geometric Primitives Cleanup (#346)
* CircleF and RectangleF

* Fix build errors
2017-03-12 20:32:07 +10:00

38 lines
1.2 KiB
C#

using Microsoft.Xna.Framework;
using NUnit.Framework;
namespace MonoGame.Extended.Tests.Primitives
{
[TestFixture]
public class EllipseFTest
{
[Test]
[TestCase(-1, -1, Result = false)]
[TestCase(110, 300, Result = true)]
[TestCase(200, 300, Result = true)]
[TestCase(290, 300, Result = true)]
[TestCase(400, 400, Result = false)]
public bool ContainsPoint_Circle(int x, int y)
{
var ellipse = new EllipseF(new Vector2(200.0f, 300.0f), 100.0f, 100.0f);
return ellipse.Contains(x, y);
}
[Test]
[TestCase(299, 400, Result = false)]
[TestCase(501, 400, Result = false)]
[TestCase(400, 199, Result = false)]
[TestCase(400, 601, Result = false)]
[TestCase(301, 400, Result = true)]
[TestCase(499, 400, Result = true)]
[TestCase(400, 201, Result = true)]
[TestCase(400, 599, Result = true)]
public bool ContainsPoint_NonCircle(int x, int y)
{
var ellipse = new EllipseF(new Vector2(400.0f, 400.0f), 100.0f, 200.0f);
return ellipse.Contains(x, y);
}
}
}