@@ -13,36 +13,36 @@ public class GCDRecursionTest {
13
13
@ ParameterizedTest
14
14
@ CsvSource ({"7, 5, 1" , "9, 12, 3" , "18, 24, 6" , "36, 60, 12" })
15
15
void testGcdPositiveNumbers (int a , int b , int expectedGcd ) {
16
- assertEquals (expectedGcd , GCD .gcd (a , b ));
16
+ assertEquals (expectedGcd , GCDRecursion .gcd (a , b ));
17
17
}
18
18
19
19
@ ParameterizedTest
20
20
@ CsvSource ({"0, 5, 5" , "8, 0, 8" })
21
21
void testGcdOneZero (int a , int b , int expectedGcd ) {
22
- assertEquals (expectedGcd , GCD .gcd (a , b ));
22
+ assertEquals (expectedGcd , GCDRecursion .gcd (a , b ));
23
23
}
24
24
25
25
@ Test
26
26
void testGcdBothZero () {
27
- assertEquals (0 , GCD .gcd (0 , 0 ));
27
+ assertEquals (0 , GCDRecursion .gcd (0 , 0 ));
28
28
}
29
29
30
30
@ ParameterizedTest
31
31
@ ValueSource (ints = {-5 , -15 })
32
32
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 ));
35
35
}
36
36
37
37
@ ParameterizedTest
38
38
@ CsvSource ({"5, 5, 5" , "8, 8, 8" })
39
39
void testGcdWithSameNumbers (int a , int b , int expectedGcd ) {
40
- assertEquals (expectedGcd , GCD .gcd (a , b ));
40
+ assertEquals (expectedGcd , GCDRecursion .gcd (a , b ));
41
41
}
42
42
43
43
@ ParameterizedTest
44
44
@ CsvSource ({"7, 13, 1" , "11, 17, 1" })
45
45
void testGcdWithPrimeNumbers (int a , int b , int expectedGcd ) {
46
- assertEquals (expectedGcd , GCD .gcd (a , b ));
46
+ assertEquals (expectedGcd , GCDRecursion .gcd (a , b ));
47
47
}
48
48
}
0 commit comments