Added condition for divide by zero check
This commit is contained in:
parent
443829bc4f
commit
0b456e3b4e
|
@ -94,7 +94,7 @@ public class ComplexNumberOperationsUnitTest {
|
||||||
Exception exception = Assertions.assertThrows(ArithmeticException.class, () -> {
|
Exception exception = Assertions.assertThrows(ArithmeticException.class, () -> {
|
||||||
complex1.divide(zero);
|
complex1.divide(zero);
|
||||||
});
|
});
|
||||||
Assertions.assertEquals(exception.getMessage(), "Division by 0 is now allowed!");
|
Assertions.assertEquals(exception.getMessage(), "Division by 0 is not allowed!");
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSame(ComplexNumber result, ComplexNumber expected) {
|
public boolean isSame(ComplexNumber result, ComplexNumber expected) {
|
||||||
|
|
Loading…
Reference in New Issue