Skip to content

Commit c54f930

Browse files
committed
Improve style.
1 parent 2d60ea9 commit c54f930

File tree

3 files changed

+15
-21
lines changed

3 files changed

+15
-21
lines changed

GoogleSignIn/Sources/GIDAuthorizationFlowProcessor/Implementations/Fakes/GIDFakeAuthorizationFlowProcessor.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,14 @@
1818

1919
#import "GoogleSignIn/Sources/GIDAuthorizationFlowProcessor/API/GIDAuthorizationFlowProcessor.h"
2020

21-
#ifdef SWIFT_PACKAGE
22-
@import AppAuth;
23-
#else
24-
#import <AppAuth/AppAuth.h>
25-
#endif
21+
@class OIDAuthorizationResponse;
2622

2723
NS_ASSUME_NONNULL_BEGIN
2824

2925
/// The block type providing the response for the method `startWithOptions:emmSupport:completion:`.
3026
///
31-
/// @param authorizationResponse The OIDAuthorizationResponse object returned if succeeded.
32-
/// @param error The error returned if failed.
27+
/// @param authorizationResponse The `OIDAuthorizationResponse` object returned on success.
28+
/// @param error The error returned on failure.
3329
typedef void(^GIDAuthorizationFlowProcessorFakeResponseProviderBlock)
3430
(OIDAuthorizationResponse *_Nullable authorizationResponse, NSError *_Nullable error);
3531

@@ -40,12 +36,12 @@ typedef void(^GIDAuthorizationFlowProcessorFakeResponseProviderBlock)
4036
typedef void (^GIDAuthorizationFlowProcessorTestBlock)
4137
(GIDAuthorizationFlowProcessorFakeResponseProviderBlock responseProvider);
4238

39+
/// The fake implementation of the protocol `GIDAuthorizationFlowProcessor`.
4340
@interface GIDFakeAuthorizationFlowProcessor : NSObject <GIDAuthorizationFlowProcessor>
4441

4542
/// The test block which provides the response value.
4643
@property(nonatomic) GIDAuthorizationFlowProcessorTestBlock testBlock;
4744

48-
4945
@end
5046

5147
NS_ASSUME_NONNULL_END

GoogleSignIn/Sources/GIDAuthorizationFlowProcessor/Implementations/Fakes/GIDFakeAuthorizationFlowProcessor.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#import "GoogleSignIn/Sources/GIDAuthorizationFlowProcessor/Implementations/Fakes/GIDFakeAuthorizationFlowProcessor.h"
22

3+
#ifdef SWIFT_PACKAGE
4+
@import AppAuth;
5+
#else
6+
#import <AppAuth/AppAuth.h>
7+
#endif
8+
39
@implementation GIDFakeAuthorizationFlowProcessor
410

511
- (void)startWithOptions:(GIDSignInInternalOptions *)options
@@ -8,7 +14,6 @@ - (void)startWithOptions:(GIDSignInInternalOptions *)options
814
NSError *_Nullable error))completion {
915
NSAssert(self.testBlock != nil, @"Set the test block before invoking this method.");
1016

11-
1217
self.testBlock(^(OIDAuthorizationResponse *authorizationResponse, NSError *error) {
1318
completion(authorizationResponse, error);
1419
});

GoogleSignIn/Tests/Unit/GIDSignInTest.m

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
// Test module imports
2727
@import GoogleSignIn;
2828

29+
#import "GoogleSignIn/Sources/GIDAuthorizationFlowProcessor/API/GIDAuthorizationFlowProcessor.h"
2930
#import "GoogleSignIn/Sources/GIDAuthorizationFlowProcessor/Implementations/Fakes/GIDFakeAuthorizationFlowProcessor.h"
3031
#import "GoogleSignIn/Sources/GIDEMMSupport.h"
3132
#import "GoogleSignIn/Sources/GIDGoogleUser_Private.h"
@@ -192,7 +193,7 @@ @interface GIDSignInTest : XCTestCase {
192193
// Fake for `GIDHTTPFetcher`.
193194
GIDFakeHTTPFetcher *_httpFetcher;
194195

195-
// Fake for `GIDAuthorizationFlowProcessor`
196+
// Fake for `GIDAuthorizationFlowProcessor`.
196197
GIDFakeAuthorizationFlowProcessor *_authorizationFlowProcessor;
197198

198199
// Fake for `GIDProfileDataFetcher`.
@@ -281,14 +282,6 @@ - (void)setUp {
281282
OCMStub([_authorization initWithAuthState:OCMOCK_ANY]).andReturn(_authorization);
282283
_user = OCMStrictClassMock([GIDGoogleUser class]);
283284
_oidAuthorizationService = OCMStrictClassMock([OIDAuthorizationService class]);
284-
// OCMStub([_oidAuthorizationService
285-
// presentAuthorizationRequest:OCMOCK_ANY
286-
//#if TARGET_OS_IOS || TARGET_OS_MACCATALYST
287-
// presentingViewController:SAVE_TO_ARG_BLOCK(self->_savedPresentingViewController)
288-
//#elif TARGET_OS_OSX
289-
// presentingWindow:SAVE_TO_ARG_BLOCK(self->_savedPresentingWindow)
290-
//#endif // TARGET_OS_IOS || TARGET_OS_MACCATALYST
291-
// callback:COPY_TO_ARG_BLOCK(self->_savedAuthorizationCallback)]);
292285
OCMStub([self->_oidAuthorizationService
293286
performTokenRequest:SAVE_TO_ARG_BLOCK(self->_savedTokenRequest)
294287
callback:COPY_TO_ARG_BLOCK(self->_savedTokenCallback)]);
@@ -1054,9 +1047,9 @@ - (void)OAuthLoginWithAddScopesFlow:(BOOL)addScopesFlow
10541047
// Set the response for `GIDProfileDataFetcher`.
10551048
GIDProfileDataFetcherTestBlock profileDataFetcherTestBlock =
10561049
^(GIDProfileDataFetcherFakeResponseProvider responseProvider) {
1057-
GIDProfileData *profileData = [GIDProfileData testInstance];
1058-
responseProvider(profileData, nil);
1059-
};
1050+
GIDProfileData *profileData = [GIDProfileData testInstance];
1051+
responseProvider(profileData, nil);
1052+
};
10601053

10611054
_profileDataFetcher.testBlock = profileDataFetcherTestBlock;
10621055

0 commit comments

Comments
 (0)