From 11d004105e9cf7506e565ae9f0998737aa60a424 Mon Sep 17 00:00:00 2001 From: Ryan Wilson Date: Mon, 17 Jul 2017 14:31:01 -0400 Subject: Add method to check if `defaultApp` is configured. (#139) This lets other SDKs check if the default `FIRApp` is set up without accessing it, which causes unnecessary log messages to appear. --- Example/Core/Tests/FIRAppTest.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Example/Core') diff --git a/Example/Core/Tests/FIRAppTest.m b/Example/Core/Tests/FIRAppTest.m index 05bec06..ab83eea 100644 --- a/Example/Core/Tests/FIRAppTest.m +++ b/Example/Core/Tests/FIRAppTest.m @@ -568,6 +568,19 @@ NSString *const kFIRTestAppName2 = @"test-app-name-2"; XCTAssertEqual([[FIRApp defaultApp] getUID], @"highlander"); } +- (void)testIsAppConfigured { + // Ensure it's false before anything is configured. + XCTAssertFalse([FIRApp isDefaultAppConfigured]); + + // Configure it and ensure it's configured. + [FIRApp configure]; + XCTAssertTrue([FIRApp isDefaultAppConfigured]); + + // Reset the apps and ensure it's not configured anymore. + [FIRApp resetApps]; + XCTAssertFalse([FIRApp isDefaultAppConfigured]); +} + #pragma mark - private - (NSDictionary *)expectedUserInfoWithAppName:(NSString *)name -- cgit v1.2.3