From 07f1f14b16224621e030bc28c53981ef8c04de3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Wielu=C5=84ski?= Date: Thu, 12 Sep 2024 22:48:10 +0200 Subject: [PATCH] Update HighScoreBoardTests.swift (#769) --- .../HighScoreBoardTests/HighScoreBoardTests.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/exercises/concept/high-score-board/Tests/HighScoreBoardTests/HighScoreBoardTests.swift b/exercises/concept/high-score-board/Tests/HighScoreBoardTests/HighScoreBoardTests.swift index 9e00372be..041184094 100644 --- a/exercises/concept/high-score-board/Tests/HighScoreBoardTests/HighScoreBoardTests.swift +++ b/exercises/concept/high-score-board/Tests/HighScoreBoardTests/HighScoreBoardTests.swift @@ -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]()