mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 00:52:43 +02:00
Refine UTs
This commit is contained in:
+9
-9
@@ -77,6 +77,15 @@ class UserSessionsDataProvider: UserSessionsDataProviderProtocol {
|
||||
}
|
||||
|
||||
extension UserSessionsDataProvider {
|
||||
private func deleteAccountDataIfNeeded(deviceList: [MXDevice]) {
|
||||
let obsoletedDeviceAccountDataKeys = obsoletedDeviceAccountData(deviceList: deviceList,
|
||||
accountDataEvents: session.accountData.allAccountDataEvents())
|
||||
|
||||
for accountDataKey in obsoletedDeviceAccountDataKeys {
|
||||
session.deleteAccountData(withType: accountDataKey, success: {}, failure: { _ in })
|
||||
}
|
||||
}
|
||||
|
||||
// internal just to facilitate tests
|
||||
func obsoletedDeviceAccountData(deviceList: [MXDevice], accountDataEvents: [String: Any]) -> Set<String> {
|
||||
let deviceAccountDataKeys = Set(
|
||||
@@ -91,13 +100,4 @@ extension UserSessionsDataProvider {
|
||||
|
||||
return deviceAccountDataKeys.subtracting(expectedDeviceAccountDataKeys)
|
||||
}
|
||||
|
||||
private func deleteAccountDataIfNeeded(deviceList: [MXDevice]) {
|
||||
let obsoletedDeviceAccountDataKeys = obsoletedDeviceAccountData(deviceList: deviceList,
|
||||
accountDataEvents: session.accountData.allAccountDataEvents())
|
||||
|
||||
for accountDataKey in obsoletedDeviceAccountDataKeys {
|
||||
session.deleteAccountData(withType: accountDataKey, success: {}, failure: { _ in })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user