I'm facing the issue to right test case for below mentioned function.
-(IBAction) returnToLogin:(UIStoryboardSegue*) segue {
NSLog(@"kiwi tested");
}
I have tried different ways but it's pass the test case
it(@"Should unwind segue", ^{
NSNumber *actionMethod = @([_vc respondsToSelector:@selector(returnToLogin:)]);
[[actionMethod should] beTrue];
});
Do you have any idea?
In the current implementation of
returnToLogin:you cannot test much, as the method is not doing anything. If the method would perform some actions, like changing the view controller hierarchy, then you would be able to assert on that behaviour.But take into consideration the following:
IBActionis not correct, anUIStoryboardSeguecannot trigger an action.