Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
viewController的iPhone单元测试_Iphone_Ios_Ipad - Fatal编程技术网

viewController的iPhone单元测试

viewController的iPhone单元测试,iphone,ios,ipad,Iphone,Ios,Ipad,我有一个控制器类,我想在其中为按钮单击时执行的代码编写测试用例。这个代码有效吗 -(void)testcheckTheArrayForNull { viewController.temp=@"c"; viewController.buttonCount=1; [viewController goButton:self]; STAssertNotNil(viewController.setUpArray,@"set up Array

我有一个控制器类,我想在其中为按钮单击时执行的代码编写测试用例。这个代码有效吗

-(void)testcheckTheArrayForNull
 {
        viewController.temp=@"c";
        viewController.buttonCount=1;
        [viewController goButton:self];
        STAssertNotNil(viewController.setUpArray,@"set up Array is not nil");


}

通过这段代码,我的控制权会转移到goButton吗?

我想这是可行的,但您没有提供goButton、setUpArray的代码,我不知道temp或buttonCount的作用是什么-所以只是猜测而已。

:好吧,忘记goButton中的代码。通过使用[viewController goButton:self]可以访问goButton中的代码吗