I have the following code (which I've dumbed down for the question):
public void HandleModeInit(int appMode){
switch(appMode){
Case 1:
DoThis();
Case 2:
DoThat();
Case 3:
//no mode 3
Case 4:
DoSomethingElse();
Case else:
//do nothing
}
}
How would you unit test this method without turning it into an integration test (where you end up testing what DoThis(), DoThat(), and DoSomethingElse() are doing)? Since these method calls are made to methods within the same class as HandleModeInit(), how would you test this?
Although ideally, the method calls would be extracted out into another class, what if this move doesn't make any sense?