I am writing Unit tests for my controller methods and many of the methods call on other methods which then also calls on other methods until finally returning a result. Now from what I have read on best practices one should test each method even if it has been essentially "tested" through another method.
To put this in perspective lets say I have these 3 methods and I do an assertTrue(MethodA) is it really necessary that I test MethodB and then MethodC as well? If so why?
public Boolean MethodA(Object o)
{
try {
//Do stuff
return MethodB(Object o);
}
catch(Exception e)
{
return false;
}
}
public Boolean MethodB(Object o)
{
try {
//Do stuff
return MethodC(Object o);
}
catch(Exception e)
{
return false;
}
}
public Boolean MethodC(Object o)
{
try {
//Do stuff with o
//return True
}
catch(Exception e)
{
return false;
}
}