Просмотр исходного кода

Change test order of execution

Also go back to using strict mocks in GIDSignInTest. This change verifies that the mocks in GIDSignInTest 'carry forward' in subsequent tests. So, if the verify account details tests run first, then there is no problme.
Matt Mathias 1 год назад
Родитель
Сommit
37ed3e4c6e

+ 2 - 2
GoogleSignIn/Tests/Unit/GIDVerifyAccountDetailTest.m → GoogleSignIn/Tests/Unit/GIDAccountDetailTest.m

@@ -40,7 +40,7 @@ static NSString * const kServerClientId = @"FakeServerClientID";
 static NSString * const kOpenIDRealm = @"FakeRealm";
 static NSString * const kFakeHostedDomain = @"fakehosteddomain.com";
 
-@interface GIDVerifyAccountDetailTests : XCTestCase
+@interface GIDAccountDetailTests : XCTestCase
 // The |UIViewController| object being tested.
 @property UIViewController *presentingViewController;
 
@@ -54,7 +54,7 @@ static NSString * const kFakeHostedDomain = @"fakehosteddomain.com";
 @property NSArray<GIDVerifiableAccountDetail *> *verifiableAccountDetails;
 @end
 
-@implementation GIDVerifyAccountDetailTests
+@implementation GIDAccountDetailTests
 
 #pragma mark - Lifecycle
 

+ 2 - 2
GoogleSignIn/Tests/Unit/GIDSignInTest.m

@@ -286,12 +286,12 @@ static NSString *const kNewScope = @"newScope";
 #elif TARGET_OS_OSX
   _presentingWindow = OCMStrictClassMock([NSWindow class]);
 #endif // TARGET_OS_IOS || TARGET_OS_MACCATALYST
-  _authState = OCMClassMock([OIDAuthState class]);
+  _authState = OCMStrictClassMock([OIDAuthState class]);
   OCMStub([_authState alloc]).andReturn(_authState);
   OCMStub([_authState initWithAuthorizationResponse:OCMOCK_ANY]).andReturn(_authState);
   _tokenResponse = OCMStrictClassMock([OIDTokenResponse class]);
   _tokenRequest = OCMStrictClassMock([OIDTokenRequest class]);
-  _authorization = OCMClassMock([GTMAuthSession class]);
+  _authorization = OCMStrictClassMock([GTMAuthSession class]);
   _keychainStore = OCMStrictClassMock([GTMKeychainStore class]);
   OCMStub(
     [_keychainStore retrieveAuthSessionWithItemName:OCMOCK_ANY error:OCMArg.anyObjectRef]