Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bunn committed Feb 21, 2024
1 parent 6bd5bae commit 3062fa4
Showing 1 changed file with 0 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3062fa4

Please sign in to comment.