Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix unit tests #12553

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Changes from all commits
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
21 changes: 6 additions & 15 deletions FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfigTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -1801,16 +1801,10 @@ - (void)testRealtimeStreamRequestBody {
}

- (void)testFetchAndActivateRolloutsNotifyInterop {
id mockNotificationCenter = [OCMockObject mockForClass:[NSNotificationCenter class]];
[[mockNotificationCenter expect] postNotificationName:@"RolloutsStateDidChangeNotification"
object:[OCMArg any]
userInfo:[OCMArg any]];
id mockSubscriber = [OCMockObject mockForProtocol:@protocol(FIRRolloutsStateSubscriber)];
[[mockSubscriber expect] rolloutsStateDidChange:[OCMArg any]];

XCTestExpectation *expectation = [self
expectationWithDescription:[NSString
stringWithFormat:@"Test rollout update send notification"]];
XCTestExpectation *notificationExpectation =
[self expectationForNotification:@"FIRRolloutsStateDidChangeNotification"
object:nil
handler:nil];

XCTAssertEqual(_configInstances[RCNTestRCInstanceDefault].lastFetchStatus,
FIRRemoteConfigFetchStatusNoFetchYet);
Expand All @@ -1826,15 +1820,12 @@ - (void)testFetchAndActivateRolloutsNotifyInterop {
XCTAssertGreaterThan(
self->_configInstances[RCNTestRCInstanceDefault].lastFetchTime.timeIntervalSince1970, 0,
@"last fetch time interval should be set.");
[expectation fulfill];
[notificationExpectation fulfill];
};

[_configInstances[RCNTestRCInstanceDefault]
fetchAndActivateWithCompletionHandler:fetchAndActivateCompletion];
[self waitForExpectationsWithTimeout:_expectationTimeout
handler:^(NSError *error) {
XCTAssertNil(error);
}];
[self waitForExpectations:@[ notificationExpectation ] timeout:_expectationTimeout];
}

#pragma mark - Test Helpers
Expand Down
Loading