【发布时间】:2013-08-23 07:42:12
【问题描述】:
我想测试以下方法:
- (void)myMethod
{
self.contact = nil;
[self performSegueWithIdentifier:@"segue id" sender:self];
}
这是我在测试课上做的:
- (void)testMyMethod
{
// Call method to test
[testClass myMethod];
// Tests
GHAssertNil(testClass.contact, @"contact should be nil.");
}
运行测试给我错误:
Reason : Receiver (<RS_MainViewController:0x126b6330>) has no segue with identifier 'segue id'
为什么会出现这个错误,解决方法是什么?
【问题讨论】:
-
您是否在情节提要中为该 segue 指定了 segue id?
标签: ios objective-c unit-testing ios6 gh-unit