@@ -26,10 +26,9 @@ @interface FIRComponentContainer (TestInternal)
26
26
@property (nonatomic , strong ) NSMutableDictionary <NSString *, FIRComponentCreationBlock> *components;
27
27
@property (nonatomic , strong ) NSMutableDictionary <NSString *, id> *cachedInstances;
28
28
29
- + (void )registerAsComponentRegistrant : (Class )klass inSet : (NSMutableSet <Class> *)allRegistrants ;
29
+ + (void )registerAsComponentRegistrant : (Class <FIRLibrary>)klass
30
+ inSet : (NSMutableSet <Class> *)allRegistrants ;
30
31
- (instancetype )initWithApp : (FIRApp *)app registrants : (NSMutableSet <Class> *)allRegistrants ;
31
- + (void )setRegistrantSet : (NSMutableSet <Class> *)testInput ;
32
- + (NSMutableSet <Class> *)registrantSet ;
33
32
@end
34
33
35
34
@interface FIRComponentContainer (TestInternalImplementations)
@@ -59,17 +58,10 @@ @implementation FIRComponentContainerTest
59
58
#pragma mark - Registration Tests
60
59
61
60
- (void )testRegisteringConformingClass {
62
- [FIRComponentContainer setRegistrantSet: [NSMutableSet <Class > set]];
63
- Class testClass = [FIRTestClass class ];
64
- [FIRComponentContainer registerAsComponentRegistrant: testClass];
65
- XCTAssertTrue ([[FIRComponentContainer registrantSet ] containsObject: testClass]);
66
- }
67
-
68
- - (void )testRegisteringNonConformingClass {
69
61
NSMutableSet <Class > *allRegistrants = [NSMutableSet <Class > set];
70
- XCTAssertThrows (
71
- [FIRComponentContainer registerAsComponentRegistrant: [ NSString class ] inSet: allRegistrants]) ;
72
- XCTAssertTrue (allRegistrants. count == 0 );
62
+ Class testClass = [FIRTestClass class ];
63
+ [FIRComponentContainer registerAsComponentRegistrant: testClass inSet: allRegistrants];
64
+ XCTAssertTrue ([ allRegistrants containsObject: testClass] );
73
65
}
74
66
75
67
- (void )testComponentsPopulatedOnInit {
@@ -161,15 +153,13 @@ - (void)testProtocolAlreadyRegistered {
161
153
// / Create a container that has registered the test class.
162
154
- (FIRComponentContainer *)containerWithRegistrants : (NSArray <Class> *)registrants {
163
155
id appMock = OCMClassMock ([FIRApp class ]);
164
- [FIRComponentContainer setRegistrantSet: [NSMutableSet <Class > set] ];
156
+ NSMutableSet < Class > *allRegistrants = [NSMutableSet <Class > set];
165
157
166
158
// Initialize the container with the test classes.
167
159
for (Class c in registrants) {
168
- [FIRComponentContainer registerAsComponentRegistrant: c];
160
+ [FIRComponentContainer registerAsComponentRegistrant: c inSet: allRegistrants ];
169
161
}
170
-
171
- return [[FIRComponentContainer alloc ] initWithApp: appMock
172
- registrants: [FIRComponentContainer registrantSet ]];
162
+ return [[FIRComponentContainer alloc ] initWithApp: appMock registrants: allRegistrants];
173
163
}
174
164
175
165
@end
0 commit comments