Skip to content

Commit 7dbb73e

Browse files
author
alxkm
committed
test: change method test
1 parent 2525e79 commit 7dbb73e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,36 @@ public class GCDRecursionTest {
1313
@ParameterizedTest
1414
@CsvSource({"7, 5, 1", "9, 12, 3", "18, 24, 6", "36, 60, 12"})
1515
void testGcdPositiveNumbers(int a, int b, int expectedGcd) {
16-
assertEquals(expectedGcd, GCD.gcd(a, b));
16+
assertEquals(expectedGcd, GCDRecursion.gcd(a, b));
1717
}
1818

1919
@ParameterizedTest
2020
@CsvSource({"0, 5, 5", "8, 0, 8"})
2121
void testGcdOneZero(int a, int b, int expectedGcd) {
22-
assertEquals(expectedGcd, GCD.gcd(a, b));
22+
assertEquals(expectedGcd, GCDRecursion.gcd(a, b));
2323
}
2424

2525
@Test
2626
void testGcdBothZero() {
27-
assertEquals(0, GCD.gcd(0, 0));
27+
assertEquals(0, GCDRecursion.gcd(0, 0));
2828
}
2929

3030
@ParameterizedTest
3131
@ValueSource(ints = {-5, -15})
3232
void testGcdNegativeNumbers(int negativeValue) {
33-
assertThrows(ArithmeticException.class, () -> GCD.gcd(negativeValue, 15));
34-
assertThrows(ArithmeticException.class, () -> GCD.gcd(15, negativeValue));
33+
assertThrows(ArithmeticException.class, () -> GCDRecursion.gcd(negativeValue, 15));
34+
assertThrows(ArithmeticException.class, () -> GCDRecursion.gcd(15, negativeValue));
3535
}
3636

3737
@ParameterizedTest
3838
@CsvSource({"5, 5, 5", "8, 8, 8"})
3939
void testGcdWithSameNumbers(int a, int b, int expectedGcd) {
40-
assertEquals(expectedGcd, GCD.gcd(a, b));
40+
assertEquals(expectedGcd, GCDRecursion.gcd(a, b));
4141
}
4242

4343
@ParameterizedTest
4444
@CsvSource({"7, 13, 1", "11, 17, 1"})
4545
void testGcdWithPrimeNumbers(int a, int b, int expectedGcd) {
46-
assertEquals(expectedGcd, GCD.gcd(a, b));
46+
assertEquals(expectedGcd, GCDRecursion.gcd(a, b));
4747
}
4848
}

0 commit comments

Comments
 (0)