Skip to content

Commit

Permalink
test: updated tests throwing errors to match expected errors
Browse files Browse the repository at this point in the history
  • Loading branch information
desusai7 committed Jun 21, 2024
1 parent 198b079 commit d303f72
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions SimpleKeychainTests/SimpleKeychainSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,15 @@ class SimpleKeychainTests: XCTestCase {
}

func testRetrievingNonExistingStringItem() {
XCTAssertThrowsError(try sut.string(forKey: "SHOULDNOTEXIST"))
XCTAssertThrowsError(try sut.string(forKey: "SHOULDNOTEXIST")) { error in
XCTAssertEqual(error as? SimpleKeychainError, .itemNotFound)
}
}

func testRetrievingNonExistingDataItem() {
XCTAssertThrowsError(try sut.data(forKey: "SHOULDNOTEXIST"))
XCTAssertThrowsError(try sut.data(forKey: "SHOULDNOTEXIST")) { error in
XCTAssertEqual(error as? SimpleKeychainError, .itemNotFound)
}
}

func testRetrievingStringItemThatCannotBeDecoded() {
Expand Down

0 comments on commit d303f72

Please sign in to comment.