recrownedgtk/RecrownedGTK.Tests/Types/RectangleTest.cs
Harrison f891abf84e Added a few more test cases to the rectangle tests.
Mostly because I was bored and recently learnt of using [TestCase()] in NUnit.
2020-02-29 18:01:56 -05:00

20 lines
581 B
C#

using NUnit.Framework;
using RecrownedGTK.Types;
namespace RecrownedGTK.Tests.Types {
[TestFixture]
public class RectangleTest {
Rectangle rectangle;
[SetUp]
public void Setup() {
rectangle = new Rectangle();
}
[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);
}
}
}