public void TestToCompare() { var fraction1 = new SimpleFraction(3, 8); var fraction2 = new SimpleFraction(5, 9); var fraction3 = new SimpleFraction(5, 9); Assert.AreEqual(-1, fraction1.CompareTo(fraction2)); Assert.AreEqual(1, fraction2.CompareTo(fraction1)); Assert.AreEqual(0, fraction2.CompareTo(fraction3)); }
public void CompareNotEqualsTest() { //Arrange var firstFraction = new SimpleFraction(1, 2); var secondFraction = new SimpleFraction(1, 4); var expectedResult = 1; //Act var result = firstFraction.CompareTo(secondFraction); //Assert Assert.AreEqual(expectedResult, result); }