Hi,
We have the following method that we need to test ( see code snippet).
I know about junit ( using 4 here) and Jmock, but all hints are
welcome.
How can I write a test that excerises createNewHome
public void createNewHome(String address){
Address newAddress = aHome.create();
switch(state) {
case INITIAL:
//Do stuff
//Set state to INVITE
case INVITE:
//Do something else
//Set state to TERMINATE
case TERMINATE:
//Do something other
//Set state to INTIAL
break;
default:
System.out.println("Not a valid state");
}
//More code .......
}