我正在工作 OCUnit 测试用例
- (NSDictionary*)Event:(EventBase*)event
{
[self doesNotRecognizeSelector:_cmd];
return nil;
}
我找到了这种方法来编写测试用例
在我的测试用例类中,我为上述方法传递了事件值有效、无效和零
-(void)testEventNil{
NSDictionary *t_Dict;
EventClass *t_EventClass = [[EventClass alloc]init];
t_Dict = [t_EventClass Event:nil];
STAssertNil (t_Dict, @"Return nil");
}
-(void)testEventNil{
NSDictionary *t_Dict;
NSMutableDictionary *invalid;
[invalid setObject:@"1324" forKey @"Number"];
EventClass *t_EventClass = [[EventClass alloc]init];
t_Dict = [t_EventClass Event:];
STAssertNil (t_Dict, @"Return nil");
}
-(void)testEventvalid{
NSDictionary *t_Dict;
NSMutableDictionary *invalid;
[invalid setObject:@"WorkNameEvent" forKey @"EventNameKey"];
EventClass *t_EventClass = [[EventClass alloc]init];
t_Dict = [t_EventClass Event:];
STAssertNotNil (t_Dict, @"Return nil");
}
它给了我错误无法识别的选择器发送到实例
任何人都可以建议我解决这个问题吗
@All 提前致谢