in FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/TournamentFetcherTests.swift [196:216]
func testHandlingTournamentFetchInvalidResult() throws {
var completionWasInvoked = false
fetcher.fetchTournaments { result in
switch result {
case let .failure(error):
guard case .decoding = error else {
return XCTFail(
"An invalid result 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.missingIdentifier, nil)
XCTAssert(completionWasInvoked)
}