-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add list() to the storage manager. (#24)
* Add list() to the storage manager. This produces a list of keys for the items currently in secure storage. --------- Co-authored-by: Todd Showalter <[email protected]>
- Loading branch information
1 parent
e5f0ca5
commit 4181b29
Showing
7 changed files
with
157 additions
and
145 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import XCTest | ||
@testable import SpruceIDMobileSdk | ||
|
||
final class StorageManagerTest: XCTestCase { | ||
func testStorage() throws { | ||
let storeman = StorageManager() | ||
let key = "test_key" | ||
let value = Data("Some random string of text. 😎".utf8) | ||
|
||
XCTAssertNoThrow(try storeman.add(key: key, value: value)) | ||
|
||
let payload = try storeman.get(key: key) | ||
|
||
XCTAssert(payload == value, "\(classForCoder):\(#function): Mismatch between stored & retrieved value.") | ||
|
||
XCTAssertNoThrow(try storeman.remove(key: key)) | ||
} | ||
} |
This file contains 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