Merge pull request #6523 from ZhangShangyu/master

add calculateUsingFactory test case
This commit is contained in:
Loredana Crusoveanu 2019-04-21 11:02:54 +03:00 committed by GitHub
commit ae723cd43f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

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