This is a companion discussion topic for the original entry at https://www.raywenderlich.com/18176818-your-first-ios-and-swiftui-app-polishing-the-app/lessons/15
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/18176818-your-first-ios-and-swiftui-app-polishing-the-app/lessons/15
Was this challenge meant to be just a challenge? In the video right before the instructions in Ray’s navigation panel he had a Test group setup with pre-written code what looks like some setting up and tear down of a test… skipping to the solution he goes to the test navigator. There is no previous mention of testing, how to setup or if it should just be expected?
@rfloresc Hey Richie! We cover Unit Testing in the previous course (Your First iOS and SwiftUI App: An App From Scratch). Here’s a link to the exact video we first talk about testing:
https://www.raywenderlich.com/17493408-your-first-ios-and-swiftui-app-an-app-from-scratch/lessons/22
I hope that helps!
Shouldn’t we change the target properties too?
func testNewRound() {
let oldTarget = game.target
game.startNewRound(points: 100)
XCTAssertEqual(game.score, 100)
XCTAssertEqual(game.round, 2)
XCTAssertNotEqual(oldTarget, game.target)
}
I write test code like that, test fail.