in FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/TournamentFetcherTests.swift [152:172]
func testHandlingTournamentFetchInvalidGraphResponse() throws {
var completionWasInvoked = false
fetcher.fetchTournaments { result in
switch result {
case let .failure(error):
guard case .decoding = error else {
return XCTFail(
"An graph response should complete with a decoding error, instead received: \(error)"
)
}
case .success:
XCTFail("Should not succeed")
}
completionWasInvoked = true
}
let completion = try XCTUnwrap(factory.capturedRequests.first?.capturedCompletionHandler)
completion(nil, SampleTournamentResults.invalidGraphAPIResponse, nil)
XCTAssert(completionWasInvoked)
}