FIRAuthInteropFake.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright 2018 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. #import "FirebaseAuth/Interop/FIRAuthInterop.h"
  18. NS_ASSUME_NONNULL_BEGIN
  19. /// A fake class to handle Auth interaction. To be used for unit testing only.
  20. @interface FIRAuthInteropFake : NSObject <FIRAuthInterop>
  21. /// The error to be returned in the `getToken` callback.
  22. @property(nonatomic, nullable, strong) NSError *error;
  23. /// The token to be returned in the `getToken` callback.
  24. @property(nonatomic, nullable, copy) NSString *token;
  25. /// The user ID to be returned from `getUserID`.
  26. @property(nonatomic, nullable, copy) NSString *userID;
  27. /// Default initializer.
  28. - (instancetype)initWithToken:(nullable NSString *)token
  29. userID:(nullable NSString *)userID
  30. error:(nullable NSError *)error NS_DESIGNATED_INITIALIZER;
  31. - (instancetype)init NS_UNAVAILABLE;
  32. @end
  33. NS_ASSUME_NONNULL_END