Skip to content

Commit

Permalink
Fixed #13, test: Added tests for increased branch coverage (#35)
Browse files Browse the repository at this point in the history
* Relating to #13, test: added test for multiplicationUsingFFT where input is zero

* Fixed #13, test: added test for multiplicationUsingLoopWithStringInput where input is zero, also added requirements comments
  • Loading branch information
Snebie committed Feb 23, 2022
1 parent 1c94212 commit 4349082
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,23 @@ public void multiplication() {
assertTrue("Multiplication using loop with int input. a=" + a + " b=" + b + " result=" + result + " check=" + check, (result == check));
}
}
@Test
public void testMultiplicationUsingFFTZero(){
long result = Integer.parseInt(Multiplication.multiplyUsingFFT("0", "0"));
long expected = 0;
//Requirement:
//When multiplying two values where one or both is zero the result should be zero
assertTrue(result == expected);
}

@Test
public void testMultiplyUsingLoopsWithStringInputZero(){
long result = Integer.parseInt(Multiplication.multiplyUsingLoopWithStringInput("0", "0"));
long expected = 0;
//Requirement:
//When multiplying two values where one or both is zero the result should be zero
assertTrue(result ==expected);
}

@Test
public void division() {
Expand Down

0 comments on commit 4349082

Please sign in to comment.