Skip to content

Commit

Permalink
Removed some more unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tobihagemann committed Oct 16, 2024
1 parent c2a1817 commit 21a95df
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
28 changes: 0 additions & 28 deletions CryptomatorFileProviderTests/FileProviderAdapterManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -226,32 +226,4 @@ class FileProviderAdapterManagerTests: XCTestCase {
XCTAssertEqual(1, maintenanceManagerMock.disableMaintenanceModeCallsCount)
XCTAssert(cache.isEmpty)
}

func testGetDomainIdentifiersOfUnlockedVaults() throws {
let unlockedDomainIdentifier = NSFileProviderDomainIdentifier(rawValue: "1")
let lockedDomainIdentifier = NSFileProviderDomainIdentifier(rawValue: "2")
notificatorManagerMock.getFileProviderNotificatorForReturnValue = fileProviderNotificatorMock
let unlockedVaultMaintenanceManagerMock = MaintenanceManagerMock()
let lockedVaultMaintenanceManagerMock = MaintenanceManagerMock()
let unlockedVaultAdapterCacheItem = AdapterCacheItem(adapter: FileProviderAdapterTypeMock(), maintenanceManager: unlockedVaultMaintenanceManagerMock, workingSetObserver: workingSetObservationMock)
let lockedVaultAdapterCacheItem = AdapterCacheItem(adapter: FileProviderAdapterTypeMock(), maintenanceManager: lockedVaultMaintenanceManagerMock, workingSetObserver: workingSetObservationMock)

var cache = [NSFileProviderDomainIdentifier: AdapterCacheItem]()
cache[unlockedDomainIdentifier] = unlockedVaultAdapterCacheItem
cache[lockedDomainIdentifier] = lockedVaultAdapterCacheItem
adapterCacheMock.getItemIdentifierClosure = { return cache[$0] }
adapterCacheMock.getAllCachedIdentifiersClosure = { cache.map { $0.key }}
adapterCacheMock.removeItemIdentifierClosure = {
cache[$0] = nil
}
vaultKeepUnlockedHelperMock.shouldAutoLockVaultWithVaultUIDClosure = { $0 != unlockedDomainIdentifier.rawValue }

XCTAssertFalse(unlockedVaultMaintenanceManagerMock.enableMaintenanceModeCalled)
XCTAssertFalse(unlockedVaultMaintenanceManagerMock.disableMaintenanceModeCalled)
XCTAssertEqual(1, lockedVaultMaintenanceManagerMock.enableMaintenanceModeCallsCount)
XCTAssertEqual(1, lockedVaultMaintenanceManagerMock.disableMaintenanceModeCallsCount)

XCTAssertEqual(1, cache.count)
XCTAssertNotNil(cache[unlockedDomainIdentifier])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,4 @@ final class FileProviderAdapterCacheTypeMock: FileProviderAdapterCacheType {
getItemIdentifierReceivedInvocations.append(identifier)
return getItemIdentifierClosure.map({ $0(identifier) }) ?? getItemIdentifierReturnValue
}

// MARK: - getAllCachedIdentifiers

var getAllCachedIdentifiersCallsCount = 0
var getAllCachedIdentifiersCalled: Bool {
getAllCachedIdentifiersCallsCount > 0
}

var getAllCachedIdentifiersReturnValue: [NSFileProviderDomainIdentifier]!
var getAllCachedIdentifiersClosure: (() -> [NSFileProviderDomainIdentifier])?
}

0 comments on commit 21a95df

Please sign in to comment.