Created
March 28, 2020 12:59
-
-
Save tedgonzalez/bbd7500ccffd2a2ac4c55eb063c7cb7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func testDecodingEmptyArraySucceeds() throws { | |
let givenJsonData = #""" | |
[] | |
"""#.data(using: .utf8)! | |
let result = try decoder.decode([OrderItem].self, from: givenJsonData) | |
let expected: [OrderItem] = [] | |
XCTAssertEqual(result, expected) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment