From 3ccaf1c752e58753bacc299e638f8f5b54738c7d Mon Sep 17 00:00:00 2001 From: Jessy Catterwaul Date: Sun, 3 Apr 2022 23:45:08 -0400 Subject: [PATCH] Use computed property instead of method --- .../Downloads/DownloadQueueManagerTest.swift | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Emitron/emitronTests/Downloads/DownloadQueueManagerTest.swift b/Emitron/emitronTests/Downloads/DownloadQueueManagerTest.swift index bca9c841..27d61fea 100644 --- a/Emitron/emitronTests/Downloads/DownloadQueueManagerTest.swift +++ b/Emitron/emitronTests/Downloads/DownloadQueueManagerTest.swift @@ -207,15 +207,17 @@ final class DownloadQueueManagerTest: XCTestCase, DatabaseTestCase { // MARK: - private private extension DownloadQueueManagerTest { - func sampleDownload() async throws -> Download { - let screencast = ContentTest.Mocks.screencast - let result = try await downloadService.requestDownload(contentID: screencast.0.id) { _ in - .init(content: screencast.0, cacheUpdate: screencast.1) - } + var sampleDownload: Download { + get async throws { + let screencast = ContentTest.Mocks.screencast + let result = try await downloadService.requestDownload(contentID: screencast.0.id) { _ in + .init(content: screencast.0, cacheUpdate: screencast.1) + } - XCTAssertEqual(result, .downloadRequestedButQueueInactive) + XCTAssertEqual(result, .downloadRequestedButQueueInactive) - return try XCTUnwrap(allDownloads.first) + return try XCTUnwrap(allDownloads.first) + } } @discardableResult func samplePersistedDownload(state: Download.State = .pending) async throws -> Download {