|
| 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