Friday, 23 August 2013

Unit testing : ViewController has no segue with identifier : "segue id"

Unit testing : ViewController has no segue with identifier : "segue id"

I want to test below method :
- (void)myMethod
{
self.contact = nil;
[self performSegueWithIdentifier:@"segue id" sender:self];
}
This is what I do in test class :
- (void)testMyMethod
{
// Call method to test
[testClass myMethod];
// Tests
GHAssertNil(testClass.contact, @"contact should be nil.");
}
Running the test gives me error :
Reason : Receiver (<RS_MainViewController:0x126b6330>) has no segue with
identifier 'segue id'
Why I get this error and what is the solution?

No comments:

Post a Comment