aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Example/Core/Tests/FIRAppTest.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/Example/Core/Tests/FIRAppTest.m b/Example/Core/Tests/FIRAppTest.m
index 8466488..707c763 100644
--- a/Example/Core/Tests/FIRAppTest.m
+++ b/Example/Core/Tests/FIRAppTest.m
@@ -596,6 +596,28 @@ NSString *const kFIRTestAppName2 = @"test-app-name-2";
XCTAssertFalse([FIRApp isDefaultAppConfigured]);
}
+- (void)testIllegalLibraryName {
+ [FIRApp registerLibrary:@"Oops>" withVersion:@"1.0.0"];
+ XCTAssertTrue([[FIRApp firebaseUserAgent] isEqualToString:@""]);
+}
+
+- (void)testIllegalLibraryVersion {
+ [FIRApp registerLibrary:@"LegalName" withVersion:@"1.0.0+"];
+ XCTAssertTrue([[FIRApp firebaseUserAgent] isEqualToString:@""]);
+}
+
+- (void)testSingleLibrary {
+ [FIRApp registerLibrary:@"LegalName" withVersion:@"1.0.0"];
+ XCTAssertTrue([[FIRApp firebaseUserAgent] isEqualToString:@"LegalName/1.0.0"]);
+}
+
+- (void)testMultipleLibraries {
+ [FIRApp registerLibrary:@"LegalName" withVersion:@"1.0.0"];
+ [FIRApp registerLibrary:@"LegalName2" withVersion:@"2.0.0"];
+ XCTAssertTrue([[FIRApp firebaseUserAgent] containsString:@"LegalName/1.0.0"]);
+ XCTAssertTrue([[FIRApp firebaseUserAgent] containsString:@"LegalName2/2.0.0"]);
+}
+
#pragma mark - private
- (NSDictionary<NSString *, NSObject *> *)expectedUserInfoWithAppName:(NSString *)name