Skip to content

Commit

Permalink
making sure that retrieving a data type is not a problem
Browse files Browse the repository at this point in the history
  • Loading branch information
EngOmarElsayed committed Mar 15, 2024
1 parent 826beec commit 32b51dd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Tests/UserDefaultsTests/UserDefaultsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ internal final class UserDefaultsTests: XCTestCase {
XCTAssertEqual(testValue.id, expectedResult.id, "Expected to have the same value got \(testValue.id)")
}

func test_UserDefaultWrapper_retrievingDataTypeAfterInitializingValue() {
let expectedResult = Data()
@UserDefault(key: DefaultKeys.testKey) var testValue = Data()

testValue = expectedResult

XCTAssertEqual(testValue, expectedResult, "Expected to have the same value got \(testValue)")
}

private func deleteArtifactsFromUserDefaults() {
UserDefaults.standard.removeObject(forKey: DefaultKeys.testKey)
}
Expand Down

0 comments on commit 32b51dd

Please sign in to comment.