From 21a95df5c80fc0ab3bd5409c6b5bcc9507269b10 Mon Sep 17 00:00:00 2001 From: Tobias Hagemann Date: Wed, 16 Oct 2024 15:36:48 +0200 Subject: [PATCH] Removed some more unused methods --- .../FileProviderAdapterManagerTests.swift | 28 ------------------- .../FileProviderAdapterCacheTypeMock.swift | 10 ------- 2 files changed, 38 deletions(-) diff --git a/CryptomatorFileProviderTests/FileProviderAdapterManagerTests.swift b/CryptomatorFileProviderTests/FileProviderAdapterManagerTests.swift index 04277b643..5838120cb 100644 --- a/CryptomatorFileProviderTests/FileProviderAdapterManagerTests.swift +++ b/CryptomatorFileProviderTests/FileProviderAdapterManagerTests.swift @@ -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]) - } } diff --git a/CryptomatorFileProviderTests/Mocks/FileProviderAdapterCacheTypeMock.swift b/CryptomatorFileProviderTests/Mocks/FileProviderAdapterCacheTypeMock.swift index e7177ac6f..94b1bcb6b 100644 --- a/CryptomatorFileProviderTests/Mocks/FileProviderAdapterCacheTypeMock.swift +++ b/CryptomatorFileProviderTests/Mocks/FileProviderAdapterCacheTypeMock.swift @@ -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])? }