FIRMultiFactorResolverTests.m 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright 2022 Google LLC
  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 <XCTest/XCTest.h>
  17. #if TARGET_OS_IOS
  18. #import "FirebaseAuth/Sources/MultiFactor/FIRMultiFactorResolver+Internal.h"
  19. #import "FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h"
  20. #import "FirebaseAuth/Sources/Public/FirebaseAuth/FIRMultiFactorInfo.h"
  21. #import "FirebaseAuth/Sources/Public/FirebaseAuth/FIRMultiFactorResolver.h"
  22. #import "FirebaseAuth/Tests/Unit/FIRApp+FIRAuthUnitTests.h"
  23. /** @class FIRMultiFactorResolverTests
  24. @brief Tests for @c FIRMultiFactorResolver.
  25. */
  26. @interface FIRMultiFactorResolverTests : XCTestCase
  27. @end
  28. @implementation FIRMultiFactorResolverTests
  29. /** @fn testMultifactorResolverCreation
  30. @brief Tests succuessful creation of a @c FIRMultiFactorResolver object.
  31. */
  32. - (void)testMultifactorResolverCreation {
  33. NSString *fakeMFAPendingCredential = @"fakeMFAPendingCredential";
  34. NSArray<FIRMultiFactorInfo *> *fakeHints = @[];
  35. FIRApp *app = [FIRApp appForAuthUnitTestsWithName:@"app"];
  36. FIRAuth *auth = [FIRAuth authWithApp:app];
  37. auth.tenantID = @"tenant-id";
  38. FIRMultiFactorResolver *resolver =
  39. [[FIRMultiFactorResolver alloc] initWithMFAPendingCredential:fakeMFAPendingCredential
  40. hints:fakeHints
  41. auth:auth];
  42. XCTAssertEqualObjects(resolver.auth, auth);
  43. XCTAssertEqualObjects(resolver.hints, fakeHints);
  44. }
  45. @end
  46. #endif