【问题标题】:Receive notifications during unit tests with XCTest?使用 XCTest 在单元测试期间接收通知?
【发布时间】:2015-01-28 16:07:42
【问题描述】:

在旧的 SenTestingKit 中,我们曾经在测试运行时收到一些非常有用的通知:

SenTestSuiteDidStartNotification
SenTestSuiteDidStopNotification
SenTestCaseDidStartNotification
SenTestCaseDidStopNotification
SenTestCaseDidFailNotification

这些还包含有关测试/套件的信息,例如失败的名称和失败描述。

这些天,XCTest 是推荐的单元测试方式,我发现有一个叫做XCTestObserver 的东西,但它已经被弃用了。那么如何根据XCTest监控单元测试的进度呢?

【问题讨论】:

    标签: unit-testing xctest


    【解决方案1】:

    这是使用模拟 http://www.hpique.com/2013/12/nsnotificationcenter-part-3/ 测试通知的一种方法

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-09
      • 2016-01-27
      • 1970-01-01
      • 2015-11-06
      • 1970-01-01
      • 1970-01-01
      • 2018-07-28
      • 2021-08-19
      相关资源
      最近更新 更多