Testing multiple scenarios under one Unit Test
This is how I am doing my unit test in groovy.
public void testSomeMethod() {
doSomething(1,2,3,4); //this is first test
doSomething(11,22,33,44); //this is second test
}
private void doSomething(a, b, c, d) {
assertEquals(a, actual)
}
Basically I am calling doSomething 2 times with different values under
same test. It might not be a good way to test But I just want to try it
out.
So, the problem is, if the first test fails second does't get executed.
Is there a way I can force it to print fail message and move on to next one?
No comments:
Post a Comment