Below is what I do.  Unless of doSomething(String) is just a forward to
doSomething(String,String).  In which case I would just test the second
method.

By forward I mean looks like this:
public void doSomething(String A)
{
        doSomething(A,DEFAULT);
}

So my test class would be:

Class TestX{
public void testDoSomethingString()
{
}
public void testDoSomethingStringString()
{
}

}

> -----Original Message-----
> From: Cumbers [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 13, 2005 8:35 AM
> To: Cactus Users List
> Subject: Overloaded class methods
> 
> 
> Hey guys
> 
> Simple question really, If a class that I want to test has overloaded 
> methods, what is the best practice for testing them? Is it to have a 
> single test method that tests both? What do others do in this 
> situation?
> 
> eg
> 
> Class X{
> 
> 
> public void doSomething(String a){}
> public void doSomething(String a, String b){}
> 
> }
> 
> Class TestX{
> 
> public void testDoSomething(){
>       //code to test both methods
> }
> }
> 
> Cheers
> 
> Rich
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

Reply via email to