Skip to content

Commit 385371e

Browse files
committed
Add testOverriden
1 parent 3390ee2 commit 385371e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Tests/iOS/Tests/Storage/StorageSupportTests.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,20 @@ final class StorageSupportTests: XCTestCase {
202202
XCTAssertTrue(error is DecodingError)
203203
}
204204
}
205+
206+
func testOverriden() throws {
207+
let intStorage = storage.support(transformer: TransformerFactory.forCodable(ofType: Int.self))
208+
let stringStorage = storage.support(transformer: TransformerFactory.forCodable(ofType: String.self))
209+
210+
let key = "sameKey"
211+
212+
try intStorage.setObject(1, forKey: key)
213+
try stringStorage.setObject("hello world", forKey: key)
214+
215+
let intValue = try? intStorage.object(forKey: key)
216+
let stringValue = try? stringStorage.object(forKey: key)
217+
218+
XCTAssertNil(intValue)
219+
XCTAssertNotNil(stringValue)
220+
}
205221
}

0 commit comments

Comments
 (0)