Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
configcat-developer committed Oct 16, 2018
1 parent de3769c commit 07ab74f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tests/ConfigCatClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,24 +136,24 @@ class ConfigCatClientTests: XCTestCase {
}

func testFailingAutoPoll() {
mockSession.enqueueResponse(response: Response(body: "", statusCode: 500))
let fetcher = ConfigFetcher(session: self.mockSession, apiKey: "")
let policy = AutoPollingPolicy(cache: InMemoryConfigCache(), fetcher: fetcher)
let client = ConfigCatClient(apiKey: "test", policyFactory: { (cache, fetcher) -> RefreshPolicy in
policy
})

mockSession.enqueueResponse(response: Response(body: "", statusCode: 500))
XCTAssertEqual("def", client.getValue(for: "fakeKey", defaultValue: "def"))
}

func testFailingExpiringCache() {
mockSession.enqueueResponse(response: Response(body: "", statusCode: 500))
let fetcher = ConfigFetcher(session: self.mockSession, apiKey: "")
let policy = ExpiringCachePolicy(cache: InMemoryConfigCache(), fetcher: fetcher)
let client = ConfigCatClient(apiKey: "test", policyFactory: { (cache, fetcher) -> RefreshPolicy in
policy
})

mockSession.enqueueResponse(response: Response(body: "", statusCode: 500))
XCTAssertEqual("def", client.getValue(for: "fakeKey", defaultValue: "def"))
}

Expand Down

0 comments on commit 07ab74f

Please sign in to comment.