Added two more basic type tests.

This commit is contained in:
Harrison Deng 2020-02-23 13:56:15 -05:00
parent 5a02f4ad6a
commit 1a8f31f7a8
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,16 @@
using NUnit.Framework;
using RecrownedGTK.Types;
namespace RecrownedGTK.Tests.Types {
[TestFixture]
public class RectangleTests {
Rectangle rectangle;
[SetUp]
public void Setup() {
rectangle = new Rectangle(3, 4, 5, 10);
}
[Test]
public void TestArea() {
Assert.AreEqual(rectangle.Area, 50);
}
}
}

View File

@ -0,0 +1,23 @@
using NUnit.Framework;
using RecrownedGTK.Types;
namespace RecrownedGTK.Tests.Types {
[TestFixture]
public class ResolutionTest {
Resolution resolution;
[SetUp]
public void Setup() {
resolution = new Resolution(1920, 1080);
}
[Test]
public void TestArea() {
Assert.AreEqual(resolution.Area(), 1920*1080);
}
[Test]
public void TestAreaCompare() {
Resolution greaterResolution = new Resolution(3840, 2160);
Assert.Positive(greaterResolution.CompareTo(resolution));
}
}
}