Skip to content

Instantly share code, notes, and snippets.

@itirokob
Created November 4, 2020 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itirokob/0f4180ec602a79fe40c698bc0b8172cb to your computer and use it in GitHub Desktop.
Save itirokob/0f4180ec602a79fe40c698bc0b8172cb to your computer and use it in GitHub Desktop.
Testing AppleAuthenticationProviders behavior
func test_didFetchAuthorizationCredential_shouldCallDelegatesDidCompleteWithCredential() {
//Given
let sut = AppleAuthenticationProvider()
sut.delegate = delegateSpy
let mockedCredential: ASAuthorizationAppleIDCredentialProtocol = MockedCredential()
//When
sut.didFetch(authorizationCredential: mockedCredential)
//Then
XCTAssertEqual(delegateSpy.authorizationCredentialPassed, mockedCredential)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment