// // GameEngineTests.swift // PenduTests // // Created by Sofiane Lasri-Trienpont on 09/05/2023. // import XCTest class GameEngineTests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testIsGameOver() throws { let game:GameEngine = GameEngine(); 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) } func testSavingScoreWithMockedEngine() throws { let game:GameEngineMock = GameEngineMock(); game.score = 10; game.playerName = "Gordon"; game.theme = "Animals"; game.difficulty = "Easy"; game.saveScore(); } }