test empty objects

This commit is contained in:
Oleksii Dykan
2017-10-23 11:37:14 +02:00
parent 3a24787560
commit 116f1983cb

View File

@@ -355,6 +355,14 @@ class TestCodableFirestore: XCTestCase {
XCTAssertEqual(try? FirestoreDecoder().decode(Document.self, from: dict) , model)
}
func testEncodingTopLevelEmptyStruct() {
_testRoundTrip(of: EmptyStruct(), expected: [:])
}
func testEncodingTopLevelEmptyClass() {
_testRoundTrip(of: EmptyClass(), expected: [:])
}
func testTypeCoercion() {
_testRoundTripTypeCoercionFailure(of: [false, true], as: [Int].self)
_testRoundTripTypeCoercionFailure(of: [false, true], as: [Int8].self)