File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Networking/NetworkingTests/Mapper Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,13 @@ final class InboxNoteListMapperTests: XCTestCase {
1414 XCTAssertEqual ( inboxNotes. count, 24 )
1515 }
1616
17+ /// Verifies that the whole list is parsed when response has no data envelope.
18+ ///
19+ func test_InboxNoteListMapper_parses_all_InboxNotes_in_response_without_data_envelope( ) throws {
20+ let inboxNotes = try mapLoadInboxNoteListResponseWithoutDataEnvelope ( )
21+ XCTAssertEqual ( inboxNotes. count, 2 )
22+ }
23+
1724 /// Verifies that the `siteID` is added in the mapper, to all results, because it's not provided by the API endpoint.
1825 ///
1926 func test_InboxNoteListMapper_includes_siteID_in_parsed_results( ) throws {
@@ -77,4 +84,10 @@ private extension InboxNoteListMapperTests {
7784 func mapLoadInboxNoteListResponse( ) throws -> [ InboxNote ] {
7885 return try mapInboxNoteList ( from: " inbox-note-list " )
7986 }
87+
88+ /// Returns the InboxNoteListMapper output from `inbox-note-list-without-data.json`
89+ ///
90+ func mapLoadInboxNoteListResponseWithoutDataEnvelope( ) throws -> [ InboxNote ] {
91+ return try mapInboxNoteList ( from: " inbox-note-list-without-data " )
92+ }
8093}
You can’t perform that action at this time.
0 commit comments