1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-09 23:15:40 +00:00

tests: 100% coverage on Circle and CircleF

This commit is contained in:
Oliver Booth 2023-03-28 16:09:35 +01:00
parent 3e4d9603c0
commit 9bb9c9692a
No known key found for this signature in database
GPG Key ID: 20BEB9DC87961025
2 changed files with 32 additions and 0 deletions

View File

@ -73,6 +73,15 @@ public class CircleFTests
Assert.IsFalse(unitCircle1 != unitCircle2);
}
[TestMethod]
public void Equals_ShouldBeTrue_GivenUnitCirclesAsObjects()
{
CircleF unitCircle1 = CircleF.Unit;
object unitCircle2 = CircleF.Unit;
Assert.AreEqual(unitCircle1, unitCircle2);
Assert.IsTrue(unitCircle1.Equals(unitCircle2));
}
[TestMethod]
public void Equals_ShouldBeFalse_GivenDifferentCircles()
{
@ -81,6 +90,13 @@ public class CircleFTests
Assert.IsTrue(CircleF.Unit != CircleF.Empty);
}
[TestMethod]
public void Equals_ShouldBeFalse_GivenDifferentObjects()
{
Assert.AreNotEqual((object?)null, CircleF.Empty);
Assert.IsFalse(CircleF.Empty.Equals(null));
}
[TestMethod]
public void GetHashCode_ShouldBeCorrect_GivenEmptyCircle()
{

View File

@ -73,6 +73,15 @@ public class CircleTests
Assert.IsFalse(unitCircle1 != unitCircle2);
}
[TestMethod]
public void Equals_ShouldBeTrue_GivenUnitCirclesAsObjects()
{
Circle unitCircle1 = Circle.Unit;
object unitCircle2 = Circle.Unit;
Assert.AreEqual(unitCircle1, unitCircle2);
Assert.IsTrue(unitCircle1.Equals(unitCircle2));
}
[TestMethod]
public void Equals_ShouldBeFalse_GivenDifferentCircles()
{
@ -81,6 +90,13 @@ public class CircleTests
Assert.IsTrue(Circle.Unit != Circle.Empty);
}
[TestMethod]
public void Equals_ShouldBeFalse_GivenDifferentObjects()
{
Assert.AreNotEqual((object?)null, Circle.Empty);
Assert.IsFalse(Circle.Empty.Equals(null));
}
[TestMethod]
public void GetHashCode_ShouldBeCorrect_GivenEmptyCircle()
{