1
我工作的OCUnit測試案例的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 預先感謝
這就是很多,也爲目標的約定規則C – kiran 2013-02-14 10:55:04
歡迎您! – Jano 2013-02-14 18:37:41