Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix formatting according to the CI requirements.
  • Loading branch information
ditman committed Sep 15, 2021
commit 44ca4b5b98c06966f9b5ba9860529dd79b93eaaf
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ - (void)setUp {
}

- (void)testUnimplementedMethod {
FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"bogus"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"bogus" arguments:nil];

XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"];
[self.plugin handleMethodCall:methodCall
Expand All @@ -50,8 +50,8 @@ - (void)testUnimplementedMethod {
}

- (void)testSignOut {
FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"signOut"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"signOut" arguments:nil];

XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"];
[self.plugin handleMethodCall:methodCall
Expand All @@ -64,8 +64,8 @@ - (void)testSignOut {
}

- (void)testDisconnect {
FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"disconnect"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"disconnect" arguments:nil];

[self.plugin handleMethodCall:methodCall
result:^(id result){
Expand All @@ -74,8 +74,8 @@ - (void)testDisconnect {
}

- (void)testClearAuthCache {
FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"clearAuthCache"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"clearAuthCache" arguments:nil];

XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"];
[self.plugin handleMethodCall:methodCall
Expand Down Expand Up @@ -103,9 +103,12 @@ - (void)testInitGamesSignInUnsupported {
}

- (void)testInitGoogleServiceInfoPlist {
FlutterMethodCall *methodCall = [FlutterMethodCall
methodCallWithMethodName:@"init"
arguments:@{@"scopes" : @[ @"mockScope1" ], @"hostedDomain" : @"example.com"}];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"init"
arguments:@{
@"scopes" : @[ @"mockScope1" ],
@"hostedDomain" : @"example.com"
}];

XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"];
[self.plugin handleMethodCall:methodCall
Expand Down Expand Up @@ -158,8 +161,8 @@ - (void)testInitDynamicClientId {
- (void)testIsNotSignedIn {
OCMStub([self.mockSignIn hasPreviousSignIn]).andReturn(NO);

FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"isSignedIn"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"isSignedIn" arguments:nil];

XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"];
[self.plugin handleMethodCall:methodCall
Expand All @@ -173,8 +176,8 @@ - (void)testIsNotSignedIn {
- (void)testIsSignedIn {
OCMStub([self.mockSignIn hasPreviousSignIn]).andReturn(YES);

FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"isSignedIn"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"isSignedIn" arguments:nil];

XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"];
[self.plugin handleMethodCall:methodCall
Expand All @@ -190,8 +193,8 @@ - (void)testIsSignedIn {
- (void)testSignInSilently {
OCMExpect([self.mockSignIn restorePreviousSignIn]);

FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"signInSilently"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"signInSilently" arguments:nil];

[self.plugin handleMethodCall:methodCall
result:^(id result){
Expand All @@ -200,8 +203,8 @@ - (void)testSignInSilently {
}

- (void)testSignInSilentlyFailsConcurrently {
FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"signInSilently"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"signInSilently" arguments:nil];

XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"];

Expand All @@ -224,8 +227,8 @@ - (void)testSignInSilentlyFailsConcurrently {
#pragma mark - Sign in

- (void)testSignIn {
FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"signIn"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"signIn" arguments:nil];

[self.plugin handleMethodCall:methodCall
result:^(NSNumber *result){
Expand All @@ -238,8 +241,8 @@ - (void)testSignIn {
}

- (void)testSignInExecption {
FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"signIn"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"signIn" arguments:nil];
OCMExpect([self.mockSignIn signIn])
.andThrow([NSException exceptionWithName:@"MockName" reason:@"MockReason" userInfo:nil]);

Expand Down Expand Up @@ -267,8 +270,8 @@ - (void)testGetTokens {
getTokensWithHandler:[OCMArg invokeBlockWithArgs:mockAuthentication, [NSNull null], nil]];
OCMStub([mockUser authentication]).andReturn(mockAuthentication);

FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"getTokens"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"getTokens" arguments:nil];

XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"];
[self.plugin handleMethodCall:methodCall
Expand All @@ -292,8 +295,8 @@ - (void)testGetTokensNoAuthKeychainError {
getTokensWithHandler:[OCMArg invokeBlockWithArgs:[NSNull null], error, nil]];
OCMStub([mockUser authentication]).andReturn(mockAuthentication);

FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"getTokens"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"getTokens" arguments:nil];

XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"];
[self.plugin handleMethodCall:methodCall
Expand All @@ -310,15 +313,14 @@ - (void)testGetTokensCancelledError {
OCMStub([self.mockSignIn currentUser]).andReturn(mockUser);

id mockAuthentication = OCMClassMock([GIDAuthentication class]);
NSError *error = [NSError errorWithDomain:kGIDSignInErrorDomain
code:kGIDSignInErrorCodeCanceled
userInfo:nil];
NSError *error =
[NSError errorWithDomain:kGIDSignInErrorDomain code:kGIDSignInErrorCodeCanceled userInfo:nil];
[[mockAuthentication stub]
getTokensWithHandler:[OCMArg invokeBlockWithArgs:[NSNull null], error, nil]];
OCMStub([mockUser authentication]).andReturn(mockAuthentication);

FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"getTokens"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"getTokens" arguments:nil];

XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"];
[self.plugin handleMethodCall:methodCall
Expand All @@ -340,8 +342,8 @@ - (void)testGetTokensURLError {
getTokensWithHandler:[OCMArg invokeBlockWithArgs:[NSNull null], error, nil]];
OCMStub([mockUser authentication]).andReturn(mockAuthentication);

FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"getTokens"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"getTokens" arguments:nil];

XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"];
[self.plugin handleMethodCall:methodCall
Expand All @@ -363,8 +365,8 @@ - (void)testGetTokensUnknownError {
getTokensWithHandler:[OCMArg invokeBlockWithArgs:[NSNull null], error, nil]];
OCMStub([mockUser authentication]).andReturn(mockAuthentication);

FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"getTokens"
arguments:nil];
FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"getTokens" arguments:nil];

XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"];
[self.plugin handleMethodCall:methodCall
Expand All @@ -381,9 +383,10 @@ - (void)testGetTokensUnknownError {
- (void)testRequestScopesResultErrorIfNotSignedIn {
OCMStub([self.mockSignIn currentUser]).andReturn(nil);

FlutterMethodCall *methodCall =
[FlutterMethodCall methodCallWithMethodName:@"requestScopes"
arguments:@{@"scopes" : @[ @"mockScope1" ]}];
FlutterMethodCall *methodCall = [FlutterMethodCall methodCallWithMethodName:@"requestScopes"
arguments:@{
@"scopes" : @[ @"mockScope1" ]
}];

XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"];
[self.plugin handleMethodCall:methodCall
Expand Down