@@ -10,19 +10,50 @@ final class RemoteBlogSettingsTests: XCTestCase {
1010 let json = try loadJSONSettings ( )
1111 let settings = RemoteBlogSettings ( jsonDictionary: json as NSDictionary )
1212
13- // Root properties
1413 XCTAssertEqual ( settings. name, " My Epic Blog " )
1514 XCTAssertEqual ( settings. tagline, " Definitely, the best blog out there " )
16- // Flattened settings properties
1715 XCTAssertEqual ( settings. privacy, 1 )
1816 XCTAssertEqual ( settings. languageID, 31337 )
1917 XCTAssertNil ( settings. iconMediaID)
2018 XCTAssertEqual ( settings. gmtOffset, 0 )
21- // And so on...
22-
23- // defaultPostFormat has custom decoding, so let's test it explicitly .
24- // Note that here we're obviously testing only one of the possible paths.
19+ XCTAssertEqual ( settings . timezoneString , " " )
20+ XCTAssertEqual ( settings . defaultCategoryID , 8 )
21+ // [!] This is the only property with custom decoding .
22+ // It would be appropriate to add additional tests to check all its paths.
2523 XCTAssertEqual ( settings. defaultPostFormat, " standard " )
24+ XCTAssertEqual ( settings. dateFormat, " m/d/Y " )
25+ XCTAssertEqual ( settings. timeFormat, " g:i a " )
26+ XCTAssertEqual ( settings. startOfWeek, " 0 " )
27+ XCTAssertEqual ( settings. postsPerPage, 12 )
28+ XCTAssertEqual ( settings. commentsAllowed, true )
29+ XCTAssertEqual ( settings. commentsBlocklistKeys, " some evil keywords " )
30+ XCTAssertEqual ( settings. commentsCloseAutomatically, false )
31+ XCTAssertEqual ( settings. commentsCloseAutomaticallyAfterDays, 3000 )
32+ XCTAssertEqual ( settings. commentsFromKnownUsersAllowlisted, true )
33+ XCTAssertEqual ( settings. commentsMaximumLinks, 42 )
34+ XCTAssertEqual ( settings. commentsModerationKeys, " moderation keys " )
35+ XCTAssertEqual ( settings. commentsPagingEnabled, true )
36+ XCTAssertEqual ( settings. commentsPageSize, 5 )
37+ XCTAssertEqual ( settings. commentsRequireManualModeration, true )
38+ XCTAssertEqual ( settings. commentsRequireNameAndEmail, false )
39+ XCTAssertEqual ( settings. commentsRequireRegistration, true )
40+ XCTAssertEqual ( settings. commentsSortOrder, " desc " )
41+ XCTAssertEqual ( settings. commentsThreadingDepth, 5 )
42+ XCTAssertEqual ( settings. commentsThreadingEnabled, true )
43+ XCTAssertEqual ( settings. pingbackInboundEnabled, true )
44+ XCTAssertEqual ( settings. pingbackOutboundEnabled, true )
45+ XCTAssertEqual ( settings. relatedPostsAllowed, true )
46+ XCTAssertEqual ( settings. relatedPostsEnabled, false )
47+ XCTAssertEqual ( settings. relatedPostsShowHeadline, true )
48+ XCTAssertEqual ( settings. relatedPostsShowThumbnails, false )
49+ XCTAssertEqual ( settings. ampSupported, true )
50+ XCTAssertEqual ( settings. ampEnabled, false )
51+ XCTAssertEqual ( settings. sharingButtonStyle, " icon-text " )
52+ XCTAssertEqual ( settings. sharingLabel, " Share this: " )
53+ XCTAssertEqual ( settings. sharingTwitterName, " gcorne " )
54+ XCTAssertEqual ( settings. sharingCommentLikesEnabled, true )
55+ XCTAssertEqual ( settings. sharingDisabledLikes, false )
56+ XCTAssertEqual ( settings. sharingDisabledReblogs, false )
2657 }
2758
2859 func testToDictionary( ) throws {
0 commit comments