【发布时间】:2017-03-13 23:51:50
【问题描述】:
我正在尝试将下面的测试用例从 quick/nimble 转换为 xctest:
expect(foundation.appGuid).toEventually(equal(guidValue))
以下是我正在使用但测试崩溃的代码:
let successPredicate = NSPredicate(format: "SELF MATCHES %@", guidValue)
expectation(for: successPredicate, evaluatedWith: foundation.appGuid) {
return foundation.appGuid == guidValue
}
waitForExpectations(timeout: 5) { (error) -> Void in
if error != nil {
XCTFail("foundation.appGuid NOT Equal to guidValue")
}
}
我在上面的代码中做错了吗?
【问题讨论】:
-
guidValue 和 appGuid 是同一类型吗?
-
是的,它们是同一类型
标签: swift nspredicate xctest