@@ -27,73 +27,69 @@ class ActivityLogTestData {
2727 return " https://wordpress.com/comment/137726971/7 "
2828 }
2929
30- private func getDictionaryFromFile ( named fileName : String ) -> [ String : AnyObject ] {
31- return JSONObject . loadFile ( named: fileName )
30+ func getCommentEventDictionary ( ) throws -> JSONObject {
31+ return try . loadFile( named: " activity-log-comment.json " )
3232 }
3333
34- func getCommentEventDictionary ( ) -> [ String : AnyObject ] {
35- return getDictionaryFromFile ( named: " activity-log-comment .json " )
34+ func getPostEventDictionary ( ) throws -> JSONObject {
35+ return try . loadFile ( named: " activity-log-post .json " )
3636 }
3737
38- func getPostEventDictionary ( ) -> [ String : AnyObject ] {
39- return getDictionaryFromFile ( named: " activity-log-post .json " )
38+ func getPingbackDictionary ( ) throws -> JSONObject {
39+ return try . loadFile ( named: " activity-log-pingback-content .json " )
4040 }
4141
42- func getPingbackDictionary ( ) -> [ String : AnyObject ] {
43- return getDictionaryFromFile ( named: " activity-log-pingback -content.json " )
42+ func getPostContentDictionary ( ) throws -> JSONObject {
43+ return try . loadFile ( named: " activity-log-post -content.json " )
4444 }
4545
46- func getPostContentDictionary ( ) -> [ String : AnyObject ] {
47- return getDictionaryFromFile ( named: " activity-log-post -content.json " )
46+ func getCommentContentDictionary ( ) throws -> JSONObject {
47+ return try . loadFile ( named: " activity-log-comment -content.json " )
4848 }
4949
50- func getCommentContentDictionary ( ) -> [ String : AnyObject ] {
51- return getDictionaryFromFile ( named: " activity-log-comment -content.json " )
50+ func getThemeContentDictionary ( ) throws -> JSONObject {
51+ return try . loadFile ( named: " activity-log-theme -content.json " )
5252 }
5353
54- func getThemeContentDictionary ( ) -> [ String : AnyObject ] {
55- return getDictionaryFromFile ( named: " activity-log-theme -content.json " )
54+ func getSettingsContentDictionary ( ) throws -> JSONObject {
55+ return try . loadFile ( named: " activity-log-settings -content.json " )
5656 }
5757
58- func getSettingsContentDictionary ( ) -> [ String : AnyObject ] {
59- return getDictionaryFromFile ( named: " activity-log-settings -content.json " )
58+ func getSiteContentDictionary ( ) throws -> JSONObject {
59+ return try . loadFile ( named: " activity-log-site -content.json " )
6060 }
6161
62- func getSiteContentDictionary ( ) -> [ String : AnyObject ] {
63- return getDictionaryFromFile ( named: " activity-log-site -content.json " )
62+ func getPluginContentDictionary ( ) throws -> JSONObject {
63+ return try . loadFile ( named: " activity-log-plugin -content.json " )
6464 }
6565
66- func getPluginContentDictionary( ) -> [ String : AnyObject ] {
67- return getDictionaryFromFile ( named: " activity-log-plugin-content.json " )
68- }
69-
70- func getCommentRangeDictionary( ) -> [ String : AnyObject ] {
71- let dictionary = getCommentContentDictionary ( )
66+ func getCommentRangeDictionary( ) throws -> JSONObject {
67+ let dictionary = try getCommentContentDictionary ( )
7268 return getRange ( at: 0 , from: dictionary)
7369 }
7470
75- func getPostRangeDictionary( ) -> [ String : AnyObject ] {
76- let dictionary = getPostContentDictionary ( )
71+ func getPostRangeDictionary( ) throws -> JSONObject {
72+ let dictionary = try getPostContentDictionary ( )
7773 return getRange ( at: 0 , from: dictionary)
7874 }
7975
80- func getThemeRangeDictionary( ) -> [ String : AnyObject ] {
81- let dictionary = getThemeContentDictionary ( )
76+ func getThemeRangeDictionary( ) throws -> JSONObject {
77+ let dictionary = try getThemeContentDictionary ( )
8278 return getRange ( at: 0 , from: dictionary)
8379 }
8480
85- func getItalicRangeDictionary( ) -> [ String : AnyObject ] {
86- let dictionary = getSettingsContentDictionary ( )
81+ func getItalicRangeDictionary( ) throws -> JSONObject {
82+ let dictionary = try getSettingsContentDictionary ( )
8783 return getRange ( at: 0 , from: dictionary)
8884 }
8985
90- func getSiteRangeDictionary( ) -> [ String : AnyObject ] {
91- let dictionary = getSiteContentDictionary ( )
86+ func getSiteRangeDictionary( ) throws -> JSONObject {
87+ let dictionary = try getSiteContentDictionary ( )
9288 return getRange ( at: 0 , from: dictionary)
9389 }
9490
95- func getPluginRangeDictionary( ) -> [ String : AnyObject ] {
96- let dictionary = getPluginContentDictionary ( )
91+ func getPluginRangeDictionary( ) throws -> JSONObject {
92+ let dictionary = try getPluginContentDictionary ( )
9793 return getRange ( at: 0 , from: dictionary)
9894 }
9995
0 commit comments