From 3062fa4eb266b38e3b251d6b1aae6c5d757f41c7 Mon Sep 17 00:00:00 2001 From: Fernando Bunn Date: Wed, 21 Feb 2024 13:37:11 +0000 Subject: [PATCH] Fix tests --- .../DataBrokerProtectionUpdaterTests.swift | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/LocalPackages/DataBrokerProtection/Tests/DataBrokerProtectionTests/DataBrokerProtectionUpdaterTests.swift b/LocalPackages/DataBrokerProtection/Tests/DataBrokerProtectionTests/DataBrokerProtectionUpdaterTests.swift index e158d9ab9f..2036ac9a1d 100644 --- a/LocalPackages/DataBrokerProtection/Tests/DataBrokerProtectionTests/DataBrokerProtectionUpdaterTests.swift +++ b/LocalPackages/DataBrokerProtection/Tests/DataBrokerProtectionTests/DataBrokerProtectionUpdaterTests.swift @@ -125,39 +125,6 @@ final class DataBrokerProtectionUpdaterTests: XCTestCase { } } - func testWhenLastRunDateIsNil_thenWeTryToUpdateBrokers() { - if let vault = self.vault { - let sut = DataBrokerProtectionBrokerUpdater(repository: repository, resources: resources, vault: vault) - repository.lastRunDate = nil - resources.brokersList = [.init(id: 1, name: "Broker", url: "broker.com", steps: [Step](), version: "1.0.1", schedulingConfig: .mock)] - - sut.checkForUpdatesInBrokerJSONFiles() - - XCTAssertTrue(repository.wasSaveLastRunDateCalled) - XCTAssertTrue(resources.wasFetchBrokerFromResourcesFilesCalled) - } else { - XCTFail("Mock vault issue") - } - } - - func testWhenSavedBrokerIsOnAnOldVersion_thenWeUpdateIt() { - if let vault = self.vault { - let sut = DataBrokerProtectionBrokerUpdater(repository: repository, resources: resources, vault: vault) - repository.lastCheckedVersion = nil - resources.brokersList = [.init(id: 1, name: "Broker", url: "broker.com", steps: [Step](), version: "1.0.1", schedulingConfig: .mock)] - vault.shouldReturnOldVersionBroker = true - - sut.checkForUpdatesInBrokerJSONFiles() - - XCTAssertTrue(repository.wasSaveLatestAppVersionCheckCalled) - XCTAssertTrue(resources.wasFetchBrokerFromResourcesFilesCalled) - XCTAssertTrue(vault.wasBrokerUpdateCalled) - XCTAssertFalse(vault.wasBrokerSavedCalled) - } else { - XCTFail("Mock vault issue") - } - } - func testWhenSavedBrokerIsOnTheCurrentVersion_thenWeDoNotUpdateIt() { if let vault = self.vault { let sut = DataBrokerProtectionBrokerUpdater(repository: repository, resources: resources, vault: vault)