用户默认值的Xcode XTestCase设置值
我试图在XCTestCase类中运行UITest,并将UserDefaults中的某个值设置为true。(我的func setUP()中除了超级调用之外没有其他内容,因此我没有发布该部分。)但是当我运行测试并在给定的ViewController中设置断点时,默认键的值没有设置为所需的值 代码如下所示:用户默认值的Xcode XTestCase设置值,xcode,userdefaults,xctestcase,Xcode,Userdefaults,Xctestcase,我试图在XCTestCase类中运行UITest,并将UserDefaults中的某个值设置为true。(我的func setUP()中除了超级调用之外没有其他内容,因此我没有发布该部分。)但是当我运行测试并在给定的ViewController中设置断点时,默认键的值没有设置为所需的值 代码如下所示: func testSomething(){ 让app=xguiapplication() app.launch() UserDefaults.standard.set(true,forKey:“
func testSomething(){
让app=xguiapplication()
app.launch()
UserDefaults.standard.set(true,forKey:“someKey”)
}