func testHandlingUpdateInvalidResult()

in FBSDKGamingServicesKit/FBSDKGamingServicesKitTests/Internal/TournamentUpdaterTest.swift [114:132]


  func testHandlingUpdateInvalidResult() throws {
    var completionWasInvoked = false
    updater.update(tournament: tournament, score: score) { result in
      switch result {
      case let .failure(error):
        guard case .decoding = error else {
          return XCTFail("Should fail with decoding error but instead failed with: \(error)")
        }
      case .success:
        XCTFail("Should not succeed")
      }
      completionWasInvoked = true
    }
    let completion = try XCTUnwrap(factory.capturedRequests.first?.capturedCompletionHandler)

    completion(nil, TournamentUpdateGraphAPIResults.invalid, nil)

    XCTAssert(completionWasInvoked)
  }