Last active
March 26, 2021 20:07
-
-
Save giovani-pereira-ifood/23ec8dc5ed236dd3018325c7fd654f92 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class IconsDataTests: XCTestCase { | |
func test_icons_shouldHaveExpectedHash() { | |
guard recordMode == false else { | |
recordReferenceHashes() | |
return | |
} | |
let storedObjects = storage.toredIconsHashes() // [IconData] | |
Icon.allCases.forEach { icon in | |
let sut = storage.hash(for: icon) | |
guard let matchingData = storedObjects.first(where: { $0.name == icon.name }) else { | |
return XCTFail("Icon \"\(icon.name)\" has not been recorded yet. Run the tests on record mode to update.") | |
} | |
XCTAssertTrue( | |
matchingData.data == sut.data, | |
"Icon \"\(icon.name)\" has been changed. Check the icon font and if this change was made on purpose. If correct, update this icon data running with recordMode enabled" | |
) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment