diff --git a/PadelClubDataTests/DataAccessSyncTests.swift b/PadelClubDataTests/DataAccessSyncTests.swift index 5d9fc02..d708299 100644 --- a/PadelClubDataTests/DataAccessSyncTests.swift +++ b/PadelClubDataTests/DataAccessSyncTests.swift @@ -69,10 +69,10 @@ struct DataAccessSyncTests { } // Setup - let eventColA: SyncedCollection = await StoreCenter.main.mainStore.synchronizedCollectionWithFileLoading() - let tournamentColA: SyncedCollection = await StoreCenter.main.mainStore.synchronizedCollectionWithFileLoading() - let eventColB: SyncedCollection = await self.secondStoreCenter.mainStore.synchronizedCollectionWithFileLoading() - let tournamentColB: SyncedCollection = await self.secondStoreCenter.mainStore.synchronizedCollectionWithFileLoading() + let eventColA: SyncedCollection = await StoreCenter.main.mainStore.asyncLoadingSynchronizedCollection() + let tournamentColA: SyncedCollection = await StoreCenter.main.mainStore.asyncLoadingSynchronizedCollection() + let eventColB: SyncedCollection = await self.secondStoreCenter.mainStore.asyncLoadingSynchronizedCollection() + let tournamentColB: SyncedCollection = await self.secondStoreCenter.mainStore.asyncLoadingSynchronizedCollection() await eventColA.deleteAsync(contentOfs: Array(eventColA)) await tournamentColA.deleteAsync(contentOfs: Array(tournamentColA)) diff --git a/PadelClubDataTests/SynchronizationTests.swift b/PadelClubDataTests/SynchronizationTests.swift index b8d6034..f4074a0 100644 --- a/PadelClubDataTests/SynchronizationTests.swift +++ b/PadelClubDataTests/SynchronizationTests.swift @@ -52,7 +52,7 @@ struct SynchronizationTests { let _: CustomUser = try await storeCenter.service().login(username: self.username, password: self.password) } - @Test("device id tests") + @Test func testDeviceIds() async throws { #expect(StoreCenter.main.deviceId() != self.secondStoreCenter.deviceId()) } @@ -69,12 +69,12 @@ struct SynchronizationTests { } // Cleanup - let eventCollection1: SyncedCollection = await StoreCenter.main.mainStore.synchronizedCollectionWithFileLoading() + let eventCollection1: SyncedCollection = await StoreCenter.main.mainStore.asyncLoadingSynchronizedCollection() #expect(eventCollection1.hasLoaded == true) await eventCollection1.deleteAsync(contentOfs: Array(eventCollection1)) - let eventCollection2: SyncedCollection = await self.secondStoreCenter.mainStore.synchronizedCollectionWithFileLoading() + let eventCollection2: SyncedCollection = await self.secondStoreCenter.mainStore.asyncLoadingSynchronizedCollection() #expect(eventCollection2.hasLoaded == true) eventCollection2.clear() @@ -114,15 +114,15 @@ struct SynchronizationTests { } // Setup events collections - let eventCollectionA: SyncedCollection = await StoreCenter.main.mainStore.synchronizedCollectionWithFileLoading() + let eventCollectionA: SyncedCollection = await StoreCenter.main.mainStore.asyncLoadingSynchronizedCollection() await eventCollectionA.deleteAsync(contentOfs: Array(eventCollectionA)) - let eventCollectionB: SyncedCollection = await self.secondStoreCenter.mainStore.synchronizedCollectionWithFileLoading() + let eventCollectionB: SyncedCollection = await self.secondStoreCenter.mainStore.asyncLoadingSynchronizedCollection() eventCollectionB.clear() // Setup clubs collections - let clubCollectionA: SyncedCollection = await StoreCenter.main.mainStore.synchronizedCollectionWithFileLoading() + let clubCollectionA: SyncedCollection = await StoreCenter.main.mainStore.asyncLoadingSynchronizedCollection() await clubCollectionA.deleteAsync(contentOfs: Array(clubCollectionA)) - let clubCollectionB: SyncedCollection = await self.secondStoreCenter.mainStore.synchronizedCollectionWithFileLoading() + let clubCollectionB: SyncedCollection = await self.secondStoreCenter.mainStore.asyncLoadingSynchronizedCollection() clubCollectionB.clear() // cleanup sync residues @@ -178,9 +178,9 @@ struct SynchronizationTests { let tournament = Tournament() // Setup TeamReg - let teamRegColA: SyncedCollection = await StoreCenter.main.mainStore.synchronizedCollectionWithFileLoading() + let teamRegColA: SyncedCollection = await StoreCenter.main.mainStore.asyncLoadingSynchronizedCollection() await teamRegColA.deleteAsync(contentOfs: Array(teamRegColA)) - let teamRegColB: SyncedCollection = await self.secondStoreCenter.mainStore.synchronizedCollectionWithFileLoading() + let teamRegColB: SyncedCollection = await self.secondStoreCenter.mainStore.asyncLoadingSynchronizedCollection() teamRegColB.clear() // cleanup sync residues @@ -204,9 +204,9 @@ struct SynchronizationTests { } // Setup events collections - let eventCollectionA: SyncedCollection = await StoreCenter.main.mainStore.synchronizedCollectionWithFileLoading() + let eventCollectionA: SyncedCollection = await StoreCenter.main.mainStore.asyncLoadingSynchronizedCollection() await eventCollectionA.deleteAsync(contentOfs: Array(eventCollectionA)) - let eventCollectionB: SyncedCollection = await self.secondStoreCenter.mainStore.synchronizedCollectionWithFileLoading() + let eventCollectionB: SyncedCollection = await self.secondStoreCenter.mainStore.asyncLoadingSynchronizedCollection() eventCollectionB.clear() // cleanup sync residues