GIDFakeProfileDataFetcher.m 914 B

1234567891011121314151617181920212223242526272829303132
  1. #import "GoogleSignIn/Sources/GIDProfileDataFetcher/Implementations/Fakes/GIDFakeProfileDataFetcher.h"
  2. #import "GoogleSignIn/Sources/Public/GoogleSignIn/GIDProfileData.h"
  3. #ifdef SWIFT_PACKAGE
  4. @import AppAuth;
  5. #else
  6. #import <AppAuth/AppAuth.h>
  7. #endif
  8. NS_ASSUME_NONNULL_BEGIN
  9. @interface GIDFakeProfileDataFetcher ()
  10. @property(nonatomic) GIDProfileDataFetcherTestBlock testBlock;
  11. @end
  12. @implementation GIDFakeProfileDataFetcher
  13. - (void)fetchProfileDataWithAuthState:(OIDAuthState *)authState
  14. completion:(void (^)(GIDProfileData *_Nullable profileData,
  15. NSError *_Nullable error))completion {
  16. NSAssert(self.testBlock != nil, @"Set the test block before invoking this method.");
  17. self.testBlock(^(GIDProfileData *_Nullable profileData, NSError *_Nullable error){
  18. completion(profileData,error);
  19. });
  20. }
  21. @end
  22. NS_ASSUME_NONNULL_END