How do you test a method which doesn’t return any values in JUnit/TestNG??
Can you control Junit/TestNG Results from tests?
These are questions I've come across during my interview? How do I answer them??
How do you test a method which doesn’t return any values in JUnit/TestNG??
Can you control Junit/TestNG Results from tests?
These are questions I've come across during my interview? How do I answer them??
You can control method fail - for example exception throwing. For example assert that the code should throw an exception. You have and array and want to check that your array. JUnit
example:
@Test(expected = SomeException.class)
public void testMethod() {
testMethod(int someValue); // You accept that it should throw an exception
}