->assertTrue(false);
->assertTrue(true);
First assertion was failed and execution was stopped. But I want to continue the further snippet of code
that defeats the point of a unit test. you might want to break it into a few more test methods instead of having a monolithic test method.
Here is some pseudo-code, as a bad example.
MyBadTestMethod()
{
someResult = MyMethod();
assertIsCorrect(someResult);
myResult2 = MyMethod2(someResult);
assertIsCorrect(myResult2);
}
MyMethod2
and myResult2
will fail.
Here is a better example.
MyTestMethod1()
{
someResult = MyMethod();
assertIsCorrect(someResult);
}
MyTestMethod2()
{
myResult2 = MyMethod2(someCorrectResult);
assertIsCorrect(myResult2);
}