Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Thanks to Codable, there's no custom parser for the models anymore. The old parser test can be moved to the test of the models instead.
- Loading branch information
1 parent
339016d
commit 43144bf
Showing
16 changed files
with
200 additions
and
326 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"id": "42", | ||
"title": "nice list title" | ||
}, | ||
{ | ||
"id": "43", | ||
"title": "another nice list title" | ||
} | ||
] |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// RequestParsersTests.swift | ||
// MastodonKit | ||
// | ||
// Created by Ornithologist Coder on 5/17/17. | ||
// Copyright © 2017 MastodonKit. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
@testable import MastodonKit | ||
|
||
class StringsTests: XCTestCase { | ||
func testDomainBlocksFromValidJSON() { | ||
let fixture = try! Fixture.load(fileName: "Fixtures/DomainBlocks.json") | ||
let parsed = try? [String].decode(data: fixture) | ||
|
||
XCTAssertEqual(parsed?.count, 3) | ||
|
||
XCTAssertTrue(parsed!.contains("toto")) | ||
XCTAssertTrue(parsed!.contains("foo")) | ||
XCTAssertTrue(parsed!.contains("bar")) | ||
} | ||
|
||
func testDomainBlocksWithInvalidData() { | ||
let parsed = try? [String].decode(data: Data()) | ||
|
||
XCTAssertNil(parsed) | ||
} | ||
} |
Oops, something went wrong.