From a91ebbbc41d0b9b8c0fc2c2c4bb738db2cfec4a7 Mon Sep 17 00:00:00 2001 From: Peter Csajtai Date: Sat, 29 Oct 2022 01:13:51 +0200 Subject: [PATCH] Fix tests --- Tests/ConfigCatTests/AsyncAwaitTests.swift | 5 ++--- Tests/ConfigCatTests/SyncTests.swift | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Tests/ConfigCatTests/AsyncAwaitTests.swift b/Tests/ConfigCatTests/AsyncAwaitTests.swift index 5b162e5..227fd93 100644 --- a/Tests/ConfigCatTests/AsyncAwaitTests.swift +++ b/Tests/ConfigCatTests/AsyncAwaitTests.swift @@ -66,7 +66,7 @@ class AsyncAwaitTests: XCTestCase { let engine = MockEngine() engine.enqueueResponse(response: Response(body: testJsonMultiple, statusCode: 200)) - let client = ConfigCatClient(sdkKey: "test", pollingMode: PollingModes.autoPoll(), httpEngine: engine) + let client = ConfigCatClient(sdkKey: "test", pollingMode: PollingModes.manualPoll(), httpEngine: engine) let result = await client.forceRefresh() let value = await client.getValue(for: "key2", defaultValue: true) XCTAssertTrue(result.success) @@ -79,7 +79,7 @@ class AsyncAwaitTests: XCTestCase { let engine = MockEngine() engine.enqueueResponse(response: Response(body: testJsonMultiple, statusCode: 200)) - let client = ConfigCatClient(sdkKey: "test", pollingMode: PollingModes.autoPoll(), httpEngine: engine) + let client = ConfigCatClient(sdkKey: "test", pollingMode: PollingModes.manualPoll(), httpEngine: engine) await client.forceRefresh() let value = await client.getValue(for: "key2", defaultValue: true) XCTAssertFalse(value) @@ -92,7 +92,6 @@ class AsyncAwaitTests: XCTestCase { engine.enqueueResponse(response: Response(body: testJsonMultiple, statusCode: 200)) let client = ConfigCatClient(sdkKey: "test", pollingMode: PollingModes.autoPoll(), httpEngine: engine) - await client.forceRefresh() let details = await client.getValueDetails(for: "key2", defaultValue: true) XCTAssertFalse(details.isDefaultValue) XCTAssertFalse(details.value) diff --git a/Tests/ConfigCatTests/SyncTests.swift b/Tests/ConfigCatTests/SyncTests.swift index dbaf239..c1df11a 100644 --- a/Tests/ConfigCatTests/SyncTests.swift +++ b/Tests/ConfigCatTests/SyncTests.swift @@ -74,8 +74,7 @@ class SyncTests: XCTestCase { func testDetails() { let engine = MockEngine() engine.enqueueResponse(response: Response(body: testJsonMultiple, statusCode: 200)) - let client = ConfigCatClient(sdkKey: "test", pollingMode: PollingModes.manualPoll(), httpEngine: engine) - client.forceRefreshSync() + let client = ConfigCatClient(sdkKey: "test", pollingMode: PollingModes.autoPoll(), httpEngine: engine) let details = client.getValueDetailsSync(for: "key2", defaultValue: true) XCTAssertFalse(details.isDefaultValue) XCTAssertFalse(details.value)