【问题标题】:How To Run XCTest in Xcode 5.1如何在 Xcode 5.1 中运行 XCTest
【发布时间】:2014-08-21 22:16:20
【问题描述】:

我正在尝试 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");
}

我在我的测试类中编写了 testAditionClass 测试方法,但是当我运行测试方法时,它在状态栏中显示了 Testing....

它甚至没有被终止。

如果有人知道解决方案,请帮助我。 提前致谢

【问题讨论】:

  • 你能在测试方法中添加一个断点来检查它是否正在运行吗?
  • @Fogmeister 我为该方法添加了一个刹车点,但它甚至没有被调用

标签: ios unit-testing xcode5 xctest


【解决方案1】:

我通过打开模拟器解决了这个问题,您将在菜单中有以下选项

如果您点击重置内容和设置。

然后尝试运行单元测试,它对我有用。

【讨论】:

    猜你喜欢
    • 2013-11-28
    • 2015-01-30
    • 1970-01-01
    • 2017-11-22
    • 2015-06-17
    • 1970-01-01
    • 1970-01-01
    • 2014-05-24
    • 2018-01-03
    相关资源
    最近更新 更多