我有一个控制器类,其中我想为按钮单击执行的代码编写测试用例。在我的testClass.m文件中,我有以下代码,我想从testClass.m调用该按钮。这段代码会起作用吗?
-(void)testcheckTheArrayForNull
{
viewController.temp=@"c";
viewController.buttonCount=1;
[viewController goButton:self];
STAssertNotNil(viewController.setUpArray,@"set up Array is not nil");
}
通过此代码将我的控制转移到goButton ???
答案 0 :(得分:0)
我会说可以工作,但你没有为goButton,setUpArray提供代码,我不知道temp或buttonCount做什么 - 所以只是猜测。