I'm a beginner in Unit Test and I would like to test my cases in a switch but I don't know how to do it.
I have :
- (void)testClickSmiley
{
[self.viewController click:nil];
// Here What i do ? I use what kind of XCTest Assertions ? I want to test if it goes into "default" for example
}
And in my ViewController :
- (IBAction)click:(id)sender
{
UIButton *btn = (UIButton *)sender;
switch (btn.tag) {
case Bad:
// Show view Bad
break;
case Average:
// Show view Average
break;
case Good:
// Show view Bad
break;
default:
break;
}
}
Of course, I don't want to modify my ViewController.
Any ideas ? TY