Skip to content

Commit

Permalink
Update HighScoreBoardTests.swift (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
landmaj authored Sep 12, 2024
1 parent a96e591 commit 07f1f14
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ final class HighScoreBoardTests: XCTestCase {
)
}

func testResetScoreNonexistentPlayer() throws {
try XCTSkipIf(true && !runAll) // change true to false to run this test
var scoreboard = [String: Int]()
addPlayer(&scoreboard, "Jesse Johnson", 1337)
addPlayer(&scoreboard, "Amil PAstorius", 99373)
addPlayer(&scoreboard, "Min-seo Shin")
resetScore(&scoreboard, "Bruno Santangelo")
XCTAssertEqual(
scoreboard,
["Jesse Johnson": 1337, "Amil PAstorius": 99373, "Min-seo Shin": 0],
"Resetting a non-existent player's score should leave the dictionary unchanged."
)
}

func testUpdateScore() throws {
try XCTSkipIf(true && !runAll) // change true to false to run this test
var scoreboard = [String: Int]()
Expand Down

0 comments on commit 07f1f14

Please sign in to comment.