add calculateUsingFactory test case
@@ -29,4 +29,11 @@ public class CalculatorUnitTest {
int result = calculator.calculate(new AddCommand(3, 7));
assertEquals(10, result);
}
+
+ @Test
+ public void whenCalculateUsingFactory_thenReturnCorrectResult() {
+ Calculator calculator = new Calculator();
+ int result = calculator.calculateUsingFactory(3, 4, "add");
+ assertEquals(7, result);
+ }
}
