AuthMocks.swift 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // Copyright 2020 Google LLC
  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
  15. @testable import FirebaseAuth
  16. let expectationTimeout: TimeInterval = 2
  17. class AuthBackendImplementationMock: NSObject, FIRAuthBackendImplementation {}
  18. extension AuthBackendImplementationMock {
  19. func createAuthURI(_ request: FIRCreateAuthURIRequest,
  20. callback: @escaping FIRCreateAuthURIResponseCallback) {
  21. fatalError("You need to implement \(#function) in your mock.")
  22. }
  23. func getAccountInfo(_ request: FIRGetAccountInfoRequest,
  24. callback: @escaping FIRGetAccountInfoResponseCallback) {
  25. fatalError("You need to implement \(#function) in your mock.")
  26. }
  27. func getProjectConfig(_ request: FIRGetProjectConfigRequest,
  28. callback: @escaping FIRGetProjectConfigResponseCallback) {
  29. fatalError("You need to implement \(#function) in your mock.")
  30. }
  31. func setAccountInfo(_ request: FIRSetAccountInfoRequest,
  32. callback: @escaping FIRSetAccountInfoResponseCallback) {
  33. fatalError("You need to implement \(#function) in your mock.")
  34. }
  35. func verifyAssertion(_ request: FIRVerifyAssertionRequest,
  36. callback: @escaping FIRVerifyAssertionResponseCallback) {
  37. fatalError("You need to implement \(#function) in your mock.")
  38. }
  39. func verifyCustomToken(_ request: FIRVerifyCustomTokenRequest,
  40. callback: @escaping FIRVerifyCustomTokenResponseCallback) {
  41. fatalError("You need to implement \(#function) in your mock.")
  42. }
  43. func verifyPassword(_ request: FIRVerifyPasswordRequest,
  44. callback: @escaping FIRVerifyPasswordResponseCallback) {
  45. fatalError("You need to implement \(#function) in your mock.")
  46. }
  47. func emailLinkSignin(_ request: FIREmailLinkSignInRequest,
  48. callback: @escaping FIREmailLinkSigninResponseCallback) {
  49. fatalError("You need to implement \(#function) in your mock.")
  50. }
  51. func secureToken(_ request: FIRSecureTokenRequest,
  52. callback: @escaping FIRSecureTokenResponseCallback) {
  53. fatalError("You need to implement \(#function) in your mock.")
  54. }
  55. func getOOBConfirmationCode(_ request: FIRGetOOBConfirmationCodeRequest,
  56. callback: @escaping FIRGetOOBConfirmationCodeResponseCallback) {
  57. fatalError("You need to implement \(#function) in your mock.")
  58. }
  59. func signUpNewUser(_ request: FIRSignUpNewUserRequest,
  60. callback: @escaping FIRSignupNewUserCallback) {
  61. fatalError("You need to implement \(#function) in your mock.")
  62. }
  63. func deleteAccount(_ request: FIRDeleteAccountRequest, callback: @escaping FIRDeleteCallBack) {
  64. fatalError("You need to implement \(#function) in your mock.")
  65. }
  66. func sendVerificationCode(_ request: FIRSendVerificationCodeRequest,
  67. callback: @escaping FIRSendVerificationCodeResponseCallback) {
  68. fatalError("You need to implement \(#function) in your mock.")
  69. }
  70. func verifyPhoneNumber(_ request: FIRVerifyPhoneNumberRequest,
  71. callback: @escaping FIRVerifyPhoneNumberResponseCallback) {
  72. fatalError("You need to implement \(#function) in your mock.")
  73. }
  74. func verifyClient(_ request: FIRVerifyClientRequest,
  75. callback: @escaping FIRVerifyClientResponseCallback) {
  76. fatalError("You need to implement \(#function) in your mock.")
  77. }
  78. func revokeToken(_ request: FIRRevokeTokenRequest,
  79. callback: @escaping FIRRevokeTokenResponseCallback) {
  80. fatalError("You need to implement \(#function) in your mock.")
  81. }
  82. func signIn(withGameCenter request: FIRSignInWithGameCenterRequest,
  83. callback: @escaping FIRSignInWithGameCenterResponseCallback) {
  84. fatalError("You need to implement \(#function) in your mock.")
  85. }
  86. func getRecaptchaConfig(_ request: FIRGetRecaptchaConfigRequest,
  87. callback: @escaping FIRGetRecaptchaConfigResponseCallback) {
  88. fatalError("You need to implement \(#function) in your mock.")
  89. }
  90. func resetPassword(_ request: FIRResetPasswordRequest,
  91. callback: @escaping FIRResetPasswordCallback) {
  92. fatalError("You need to implement \(#function) in your mock.")
  93. }
  94. func call(with request: FIRAuthRPCRequest, response: FIRAuthRPCResponse,
  95. callback: @escaping (Error?) -> Void) {
  96. fatalError("You need to implement \(#function) in your mock.")
  97. }
  98. }