Skip to content

Commit 1bc7d97

Browse files
authored
Update ADTFractionTest.java
1 parent 04eae87 commit 1bc7d97

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/java/com/thealgorithms/maths/ADTFractionTest.java

+6
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,10 @@ public void testEqualsAndHashCode() {
4949
public void testToString() {
5050
assertEquals("3/5", fraction1.toString());
5151
}
52+
@Test
53+
public void testMinus() {
54+
// expected: 3/5 - 7/8 = (3*8 - 5*7)/(5*8) = (24 - 35)/40 = -11/40
55+
assertEquals(new ADTFraction(-11, 40), fraction1.minus(fraction2));
56+
}
57+
5258
}

0 commit comments

Comments
 (0)