Skip to content

Commit

Permalink
Updated iOS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LTPhantom committed Dec 19, 2023
1 parent c3dad50 commit e846c67
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ - (void)testSetSameAppKeyEnabledYes {
XCTAssertTrue(resultInvoked);
XCTAssertNil(returnedResult);
OCMVerify([gadRequestConfigurationMock
setSameAppKeyEnabled:[OCMArg isEqual:@(YES)]]);
setPublisherFirstPartyIDEnabled:[OCMArg isEqual:@(YES)]]);
}

- (void)testRegisterWebView {
Expand Down Expand Up @@ -226,7 +226,8 @@ - (void)testSetSameAppKeyEnabledNo {

XCTAssertTrue(resultInvoked);
XCTAssertNil(returnedResult);
OCMVerify([gadRequestConfigurationMock setSameAppKeyEnabled:NO]);
OCMVerify(
[gadRequestConfigurationMock setPublisherFirstPartyIDEnabled:NO]);

FlutterMethodCall *methodCallWithBool = [FlutterMethodCall
methodCallWithMethodName:@"MobileAds#setSameAppKeyEnabled"
Expand All @@ -244,7 +245,8 @@ - (void)testSetSameAppKeyEnabledNo {

XCTAssertTrue(resultInvokedWithBool);
XCTAssertNil(returnedResultWithBool);
OCMVerify([gadRequestConfigurationMock setSameAppKeyEnabled:NO]);
OCMVerify(
[gadRequestConfigurationMock setPublisherFirstPartyIDEnabled:NO]);
}

- (void)testSetAppMuted {
Expand Down Expand Up @@ -361,7 +363,8 @@ - (void)testGetVersionString {
[_fltGoogleMobileAdsPlugin handleMethodCall:methodCall result:result];

XCTAssertTrue(resultInvoked);
XCTAssertEqual(returnedResult, [GADMobileAds.sharedInstance sdkVersion]);
XCTAssertEqual(returnedResult,
GADGetStringFromVersionNumber(GADMobileAds.sharedInstance.versionNumber));
}

- (void)testOpenDebugMenu {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ - (void)testEncodeDecodeRequestConfiguration {
GADRequestConfiguration *requestConfiguration =
[GADRequestConfiguration alloc];
requestConfiguration.maxAdContentRating = GADMaxAdContentRatingMatureAudience;
[GADMobileAds.sharedInstance.requestConfiguration
tagForChildDirectedTreatment:YES];
[GADMobileAds.sharedInstance.requestConfiguration tagForUnderAgeOfConsent:NO];
GADMobileAds.sharedInstance.requestConfiguration
.tagForChildDirectedTreatment = @YES;
GADMobileAds.sharedInstance.requestConfiguration
.tagForUnderAgeOfConsent = @NO;
NSArray<NSString *> *testDeviceIds =
[[NSArray alloc] initWithObjects:@"test-device-id", nil];
requestConfiguration.testDeviceIdentifiers = testDeviceIds;
Expand Down Expand Up @@ -383,7 +384,8 @@ - (void)testEncodeDecodeFLTGADLoadError {
NSString *identifier = @"test-identifier";
NSString *className = @"test-class-name";
OCMStub([mockResponseInfo responseIdentifier]).andReturn(identifier);
OCMStub([mockResponseInfo adNetworkClassName]).andReturn(className);
OCMStub(mockResponseInfo.loadedAdNetworkResponseInfo.adNetworkClassName)
.andReturn(className);
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey : @"message",
GADErrorUserInfoKeyResponseInfo : mockResponseInfo
Expand Down Expand Up @@ -413,7 +415,8 @@ - (void)testEncodeDecodeFLTGADLoadErrorWithResponseInfo {
NSString *identifier = @"test-identifier";
NSString *className = @"test-class-name";
OCMStub([mockResponseInfo responseIdentifier]).andReturn(identifier);
OCMStub([mockResponseInfo adNetworkClassName]).andReturn(className);
OCMStub(mockResponseInfo.loadedAdNetworkResponseInfo.adNetworkClassName)
.andReturn(className);
OCMStub([mockResponseInfo adNetworkInfoArray]).andReturn(@[
mockNetworkResponse
]);
Expand Down

0 comments on commit e846c67

Please sign in to comment.