Skip to content

Commit

Permalink
test: Add some more tests for checking square root.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishwajeet-29-pro committed Sep 23, 2024
1 parent cc2f5aa commit 2ffe805
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,20 @@ public void testSquareRootForAbsoluteValue() {
int result = squareRoot.mySqrt(input);
assertEquals(expected, result);
}

@Test
public void testSquareRootForEight() {
int input = 8;
int expected = 2;
assertEquals(expected, squareRoot.mySqrt(input));
}

@Test
public void testMultipleSquareRoots() {
assertEquals(3, squareRoot.mySqrt(9));
assertEquals(3, squareRoot.mySqrt(10));
assertEquals(6, squareRoot.mySqrt(36));
assertEquals(6, squareRoot.mySqrt(37));
}
}

0 comments on commit 2ffe805

Please sign in to comment.