Added two more basic type tests.
This commit is contained in:
parent
5a02f4ad6a
commit
1a8f31f7a8
16
RecrownedGTK.Tests/Types/RectangleTests.cs
Normal file
16
RecrownedGTK.Tests/Types/RectangleTests.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
23
RecrownedGTK.Tests/Types/ResolutionTest.cs
Normal file
23
RecrownedGTK.Tests/Types/ResolutionTest.cs
Normal 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));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user