Merge pull request #6523 from ZhangShangyu/master
add calculateUsingFactory test case
This commit is contained in:
commit
ae723cd43f
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue