From 9f30b15af58e16c7015477b050f67d4f311361bf Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 16 Nov 2024 13:31:49 -0800 Subject: [PATCH] =?UTF-8?q?Get=20AccountTests=20building=20(and=20passing)?= =?UTF-8?q?=20by=20deleting=20some=20test=20support=20code=20that=20wouldn?= =?UTF-8?q?=E2=80=99t=20compile=20=E2=80=94=20but=20that=20was=20unused=20?= =?UTF-8?q?anyway.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Feedly/FeedlyTestSupport.swift | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/Account/Tests/AccountTests/Feedly/FeedlyTestSupport.swift b/Account/Tests/AccountTests/Feedly/FeedlyTestSupport.swift index 70e7207a0..4a7b898a2 100644 --- a/Account/Tests/AccountTests/Feedly/FeedlyTestSupport.swift +++ b/Account/Tests/AccountTests/Feedly/FeedlyTestSupport.swift @@ -145,15 +145,6 @@ class FeedlyTestSupport { XCTAssertTrue(missingFeedIds.isEmpty, "Feeds with these ids were not found in the \"\(label)\" folder.") } - func checkArticles(in account: Account, againstItemsInStreamInJSONNamed name: String, subdirectory: String? = nil) throws { - let stream = testJSON(named: name, subdirectory: subdirectory) as! [String:Any] - try checkArticles(in: account, againstItemsInStreamInJSONPayload: stream) - } - - func checkArticles(in account: Account, againstItemsInStreamInJSONPayload stream: [String: Any]) throws { - try checkArticles(in: account, correspondToStreamItemsIn: stream) - } - private struct ArticleItem { var id: String var feedId: String @@ -190,32 +181,7 @@ class FeedlyTestSupport { self.unread = item["unread"] as! Bool } } - - /// Awkwardly titled to make it clear the JSON given is from a stream response. - func checkArticles(in testAccount: Account, correspondToStreamItemsIn stream: [String: Any]) throws { - let items = stream["items"] as! [[String: Any]] - let articleItems = items.map { ArticleItem(item: $0) } - let itemIds = Set(articleItems.map { $0.id }) - - let articles = try testAccount.fetchArticles(.articleIDs(itemIds)) - let articleIds = Set(articles.map { $0.articleID }) - - let missing = itemIds.subtracting(articleIds) - - XCTAssertEqual(items.count, articles.count) - XCTAssertTrue(missing.isEmpty, "Items with these ids did not have a corresponding article with the same id.") - - for article in articles { - for item in articleItems where item.id == article.articleID { - XCTAssertEqual(article.uniqueID, item.id) - XCTAssertEqual(article.contentHTML, item.content) - XCTAssertEqual(article.feedID, item.feedId) - XCTAssertEqual(article.externalURL, item.externalUrl) - } - } - } - func checkUnreadStatuses(in account: Account, againstIdsInStreamInJSONNamed name: String, subdirectory: String? = nil, testCase: XCTestCase) { let streamIds = testJSON(named: name, subdirectory: subdirectory) as! [String:Any] checkUnreadStatuses(in: account, correspondToIdsInJSONPayload: streamIds, testCase: testCase)