From 4e0ebce29349234dc89063614f2e46d08aa6f905 Mon Sep 17 00:00:00 2001 From: Ethan Wong Date: Wed, 25 May 2022 21:37:55 +0800 Subject: [PATCH] Fix ModelTests failure. --- DoughnutTests/ModelTests/PodcastModelTests.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/DoughnutTests/ModelTests/PodcastModelTests.swift b/DoughnutTests/ModelTests/PodcastModelTests.swift index ad22f6b..ecc09cf 100644 --- a/DoughnutTests/ModelTests/PodcastModelTests.swift +++ b/DoughnutTests/ModelTests/PodcastModelTests.swift @@ -52,7 +52,12 @@ final class PodcastModelTests: ModelTestCase { XCTAssertEqual(podcast.language, "en-us") XCTAssertEqual(podcast.copyright, "© 2017 Chris Dyer") XCTAssertEqual(podcast.pubDate, dateFormatter.date(from: "2017-09-25T23:30:07Z")) - XCTAssertEqual(podcast.image?.size, CGSize(width: 100, height: 100)) + + let imageRepresentation = podcast.image?.representations.first + XCTAssertNotNil(imageRepresentation) + XCTAssertEqual(imageRepresentation?.pixelsHigh, 100) + XCTAssertEqual(imageRepresentation?.pixelsWide, 100) + XCTAssertEqual(podcast.imageUrl, "http://localhost/image.jpg") XCTAssertEqual(podcast.lastParsed, dateFormatter.date(from: "2022-03-20T08:09:09Z")) XCTAssertEqual(podcast.subscribedAt, dateFormatter.date(from: "2022-03-20T08:09:09Z"))