I am new with unit test. This is the first time I am writing unit test. I am trying to write Unit tests using TestNG framework.
class A {
public Return_type method1(param1, param2) {
for(var : tillSomeValue) {
try {
value = someMethod(var);
} catch (someException ex) {
/* do some calculation here with the value of thrown exception */
throw anotherException();
}
}
}
}
I want to write Unit tests for this class. Can some give me some leads?