简体   繁体   English

如何在Xcode 5.1中运行XCTest

[英]How To Run XCTest in Xcode 5.1

I'm trying the XCTest framework 我正在尝试XCTest框架

@implementation UnitTestPOCTests

- (void)setUp
{
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown
{
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testAditionClass
{
    Addition *addObj = [[Addition alloc]init];
    XCTAssertNotNil(addObj,@"AddtionClassExists");
}

I wrote the testAditionClass test method inside my test class, but when i run the test methods its showing Testing.... in the status bar 我在测试类中编写了testAditionClass测试方法,但是当我运行测试方法时,其在状态栏中显示Testing....。

在此处输入图片说明

its not even getting terminated. 它甚至没有终止。

If any one know the the solution please help me. 如果有人知道解决方案,请帮助我。 Thanks in advance 提前致谢

I resolved this problem by opening the simulator you will have the following options in menu 我通过打开模拟器解决了此问题,您将在菜单中具有以下选项

在此处输入图片说明

if you tap on reset content and setting. 如果您点击重置内容和设置。

Then try running unit test it works for me. 然后尝试运行单元测试,它对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM