GULCCTestComponents.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Copyright 2019 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 <GoogleUtilitiesComponents/GULCCComponent.h>
  16. #import <GoogleUtilitiesComponents/GULCCComponentContainer.h>
  17. #import <GoogleUtilitiesComponents/GULCCLibrary.h>
  18. #pragma mark - Standard Component
  19. /// A test protocol to be used for container testing.
  20. @protocol GULCCTestProtocol
  21. - (void)doSomething;
  22. @end
  23. /// A test class that is a component registrant.
  24. @interface GULCCTestClass
  25. : NSObject <GULCCTestProtocol, GULCCComponentLifecycleMaintainer, GULCCLibrary>
  26. @end
  27. /// A test class that is a component registrant, a duplicate of GULCCTestClass.
  28. @interface GULCCTestClassDuplicate
  29. : NSObject <GULCCTestProtocol, GULCCComponentLifecycleMaintainer, GULCCLibrary>
  30. @end
  31. #pragma mark - Eager Component
  32. /// A test protocol to be used for container testing.
  33. @protocol GULCCTestProtocolEagerCached
  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 GULCCTestClassEagerCached
  39. : NSObject <GULCCTestProtocolEagerCached, GULCCComponentLifecycleMaintainer, GULCCLibrary>
  40. @end
  41. #pragma mark - Cached Component
  42. /// A test protocol to be used for container testing.
  43. @protocol GULCCTestProtocolCached
  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 GULCCTestClassCached
  49. : NSObject <GULCCTestProtocolCached, GULCCComponentLifecycleMaintainer, GULCCLibrary>
  50. @end
  51. #pragma mark - Dependency on Standard
  52. /// A test protocol to be used for container testing.
  53. @protocol GULCCTestProtocolCachedWithDep
  54. @property(nonatomic, strong) id<GULCCTestProtocolCached> testProperty;
  55. @end
  56. /// A test class that is a component registrant that provides a component with a dependency on
  57. // `GULCCTestProtocolCached`.
  58. @interface GULCCTestClassCachedWithDep
  59. : NSObject <GULCCTestProtocolCachedWithDep, GULCCComponentLifecycleMaintainer, GULCCLibrary>
  60. @property(nonatomic, strong) id<GULCCTestProtocolCached> testProperty;
  61. - (instancetype)initWithTest:(id<GULCCTestProtocolCached>)testInstance;
  62. @end