Sometimes I come across situations where all I need to check is whether the program execution reaches a certain point without any exceptions or the program is interrupted or falls into an infinite loop or something like that.
I do not understand how to write unit test for this.
For example, consider the following "unit test" -
@Test
public void testProgramExecution()
{
Program program = new Program();
program.executeStep1();
program.executeStep2();
program.executeStep3();
}
Usually, at the end of the test, I have an operator like -
assertEquals(expectedString, actualString);
But how to write assertEquals or another type of test instruction for the above case?
source
share