Skip to content

Commit 2fb87c3

Browse files
authored
Add tests for PythagoreanTriple (TheAlgorithms#3070)
1 parent 2bcae52 commit 2fb87c3

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.thealgorithms.maths;
2+
3+
import org.junit.jupiter.api.Test;
4+
import static org.junit.jupiter.api.Assertions.assertEquals;
5+
6+
public class PythagoreanTripleTest {
7+
@Test
8+
public void Testpythagoreantriple(){
9+
10+
assertEquals(true, PythagoreanTriple.isPythagTriple(3,4,5));
11+
assertEquals(true, PythagoreanTriple.isPythagTriple(6,8,10));
12+
assertEquals(true, PythagoreanTriple.isPythagTriple(9,12,15));
13+
assertEquals(true, PythagoreanTriple.isPythagTriple(12,16,20));
14+
assertEquals(true, PythagoreanTriple.isPythagTriple(15,20,25));
15+
assertEquals(true, PythagoreanTriple.isPythagTriple(18,24,30));
16+
assertEquals(false, PythagoreanTriple.isPythagTriple(5,20,30));
17+
assertEquals(false, PythagoreanTriple.isPythagTriple(6,8,100));
18+
assertEquals(false, PythagoreanTriple.isPythagTriple(-2,-2,2));
19+
}
20+
}

0 commit comments

Comments
 (0)