From 116f1983cb533570d936d418920fc03609ae8efd Mon Sep 17 00:00:00 2001 From: Oleksii Dykan Date: Mon, 23 Oct 2017 11:37:14 +0200 Subject: [PATCH] test empty objects --- CodableFirebaseTests/TestCodableFirestore.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CodableFirebaseTests/TestCodableFirestore.swift b/CodableFirebaseTests/TestCodableFirestore.swift index 0807c72..354e02d 100644 --- a/CodableFirebaseTests/TestCodableFirestore.swift +++ b/CodableFirebaseTests/TestCodableFirestore.swift @@ -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)