Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 XCode 6.1、Swift 和 KIF 进行测试。
有什么方法(如处理器)来定义let调试值和另一个特定于测试环境的值吗?
let
Swift 允许在文件范围级别使用计算属性,从而实现以下目标:
var testIsRunning = false var isDebugging: Bool { return testIsRunning ? false : true }
您可以在测试用例的方法中设置testIsRunning为。true-setUp
testIsRunning
true
-setUp