GIDFakeHTTPFetcher.m 788 B

1234567891011121314151617181920212223
  1. #import "GoogleSignIn/Sources/GIDHTTPFetcher/Implementations/Fakes/GIDFakeHTTPFetcher.h"
  2. @interface GIDFakeHTTPFetcher ()
  3. @property(nonatomic) GIDHTTPFetcherTestBlock testBlock;
  4. @end
  5. @implementation GIDFakeHTTPFetcher
  6. - (void)fetchURLRequest:(NSURLRequest *)urlRequest
  7. #pragma clang diagnostic ignored "-Wdeprecated-declarations"
  8. withFetcherService:(id<GTMSessionFetcherServiceProtocol>)fetcherService
  9. #pragma clang diagnostic pop
  10. withComment:(NSString *)comment
  11. completion:(void (^)(NSData *_Nullable, NSError *_Nullable))completion {
  12. NSAssert(self.testBlock != nil, @"Set the test block before invoking this method.");
  13. self.testBlock(urlRequest, ^(NSData *_Nullable data, NSError *_Nullable error) {
  14. completion(data, error);
  15. });
  16. }
  17. @end