Skip to content
Snippets Groups Projects
Commit cd889d89 authored by yanis's avatar yanis
Browse files

Test de StartNewGame()

parent 0a0f05cc
Branches
No related tags found
No related merge requests found
......@@ -64,7 +64,7 @@ class GameEngine: NSObject {
word = listThemeCitiesHard[randomInt]
}
} else if theme == "Colors"{
if difficulty == "Easy"{
if difficulty == "GrosseFesse"{
let randomInt = Int.random(in: 0..<listThemeColorsEasy.count)
word = listThemeColorsEasy[randomInt]
} else {
......@@ -76,7 +76,7 @@ class GameEngine: NSObject {
}
public func startNewGame(difficulty: String) -> Void {
// Réinitialisation des propriétés et génération d'un nouveau mot à deviner
print(WordToGuess(theme: "Animals", difficulty: "Easy"))
}
public func guessLetter(letter: Character) -> Void {
......
......@@ -22,4 +22,11 @@ class GameEngineTests: XCTestCase {
XCTAssertEqual(false, game.isGameOver());
}
func testStartNewGame() throws {
let game:GameEngine = GameEngine();
let mot1 = game.WordToGuess(theme: "Sports", difficulty: "Hard")
let mot2 = game.WordToGuess(theme: "Sports", difficulty: "Hard")
XCTAssertNotEqual(mot1, mot2)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment