FIRTestComponents.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Copyright 2018 Google
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <Foundation/Foundation.h>
  15. #import <FirebaseCore/FIRComponent.h>
  16. #import <FirebaseCore/FIRComponentContainer.h>
  17. #import <FirebaseCore/FIRLibrary.h>
  18. @protocol FIRComponentRegistrant;
  19. #pragma mark - Standard Component
  20. /// A test protocol to be used for container testing.
  21. @protocol FIRTestProtocol
  22. - (void)doSomething;
  23. @end
  24. /// A test class that is a component registrant.
  25. @interface FIRTestClass : NSObject <FIRTestProtocol, FIRComponentLifecycleMaintainer, FIRLibrary>
  26. @end
  27. /// A test class that is a component registrant, a duplicate of FIRTestClass.
  28. @interface FIRTestClassDuplicate
  29. : NSObject <FIRTestProtocol, FIRComponentLifecycleMaintainer, FIRLibrary>
  30. @end
  31. #pragma mark - Eager Component
  32. /// A test protocol to be used for container testing.
  33. @protocol FIRTestProtocolEagerCached
  34. - (void)doSomethingFaster;
  35. @end
  36. /// A test class that is a component registrant that provides a component requiring eager
  37. /// instantiation, and is cached for easier validation that it was instantiated.
  38. @interface FIRTestClassEagerCached
  39. : NSObject <FIRTestProtocolEagerCached, FIRComponentLifecycleMaintainer, FIRLibrary>
  40. @end
  41. #pragma mark - Cached Component
  42. /// A test protocol to be used for container testing.
  43. @protocol FIRTestProtocolCached
  44. - (void)cacheCow;
  45. @end
  46. /// A test class that is a component registrant that provides a component that requests to be
  47. /// cached.
  48. @interface FIRTestClassCached
  49. : NSObject <FIRTestProtocolCached, FIRComponentLifecycleMaintainer, FIRLibrary>
  50. @end
  51. #pragma mark - Dependency on Standard
  52. /// A test protocol to be used for container testing.
  53. @protocol FIRTestProtocolCachedWithDep
  54. @property(nonatomic, strong) id<FIRTestProtocolCached> testProperty;
  55. @end
  56. /// A test class that is a component registrant that provides a component with a dependency on
  57. // `FIRTestProtocolCached`.
  58. @interface FIRTestClassCachedWithDep
  59. : NSObject <FIRTestProtocolCachedWithDep, FIRComponentLifecycleMaintainer, FIRLibrary>
  60. @property(nonatomic, strong) id<FIRTestProtocolCached> testProperty;
  61. - (instancetype)initWithTest:(id<FIRTestProtocolCached>)testInstance;
  62. @end