Skip to content

Commit

Permalink
Add tests for PythagoreanTriple (#3070)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ph1eu authored and Jtmonument committed Jun 9, 2022
1 parent 50a22dd commit d9ada10
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/java/com/thealgorithms/maths/PythagoreanTripleTest.java
@@ -0,0 +1,20 @@
package com.thealgorithms.maths;

import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class PythagoreanTripleTest {
@Test
public void Testpythagoreantriple(){

assertEquals(true, PythagoreanTriple.isPythagTriple(3,4,5));
assertEquals(true, PythagoreanTriple.isPythagTriple(6,8,10));
assertEquals(true, PythagoreanTriple.isPythagTriple(9,12,15));
assertEquals(true, PythagoreanTriple.isPythagTriple(12,16,20));
assertEquals(true, PythagoreanTriple.isPythagTriple(15,20,25));
assertEquals(true, PythagoreanTriple.isPythagTriple(18,24,30));
assertEquals(false, PythagoreanTriple.isPythagTriple(5,20,30));
assertEquals(false, PythagoreanTriple.isPythagTriple(6,8,100));
assertEquals(false, PythagoreanTriple.isPythagTriple(-2,-2,2));
}
}

0 comments on commit d9ada10

Please sign in to comment.