mirror of
https://github.com/hyperoslo/Cache.git
synced 2026-04-07 19:17:36 +00:00
Add testOverriden
This commit is contained in:
@@ -202,4 +202,20 @@ final class StorageSupportTests: XCTestCase {
|
||||
XCTAssertTrue(error is DecodingError)
|
||||
}
|
||||
}
|
||||
|
||||
func testOverriden() throws {
|
||||
let intStorage = storage.support(transformer: TransformerFactory.forCodable(ofType: Int.self))
|
||||
let stringStorage = storage.support(transformer: TransformerFactory.forCodable(ofType: String.self))
|
||||
|
||||
let key = "sameKey"
|
||||
|
||||
try intStorage.setObject(1, forKey: key)
|
||||
try stringStorage.setObject("hello world", forKey: key)
|
||||
|
||||
let intValue = try? intStorage.object(forKey: key)
|
||||
let stringValue = try? stringStorage.object(forKey: key)
|
||||
|
||||
XCTAssertNil(intValue)
|
||||
XCTAssertNotNil(stringValue)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user