Added a few more test cases to the rectangle tests.

Mostly because I was bored and recently learnt of using [TestCase()] in NUnit.
This commit is contained in:
Harrison Deng 2020-02-29 18:01:56 -05:00
parent 19163aaa12
commit f891abf84e

View File

@ -6,11 +6,15 @@ namespace RecrownedGTK.Tests.Types {
Rectangle rectangle;
[SetUp]
public void Setup() {
rectangle = new Rectangle(3, 4, 5, 10);
rectangle = new Rectangle();
}
[Test]
public void TestArea() {
Assert.AreEqual(rectangle.Area, 50);
[TestCase(20, 40, 800)]
[TestCase(0, 40, 0)]
[TestCase(1f, 3.5f, 3.5f)]
public void TestArea(float width, float height, float expected) {
rectangle.Width = width;
rectangle.Height = height;
Assert.AreEqual(expected, rectangle.Area);
}
}
}