GIDAuthFlowTest.m 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright 2024 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. #import "GoogleSignIn/Sources/GIDAuthFlow.h"
  18. #import "GoogleSignIn/Tests/Unit/GIDProfileData+Testing.h"
  19. #import "GoogleSignIn/Tests/Unit/OIDAuthState+Testing.h"
  20. @interface GIDAuthFlowTest : XCTestCase
  21. @end
  22. @implementation GIDAuthFlowTest
  23. - (void)testInitWithAuthState {
  24. OIDAuthState *authState = [OIDAuthState testInstance];
  25. GIDProfileData *profileData = [GIDProfileData testInstance];
  26. GIDAuthFlow *authFlow = [[GIDAuthFlow alloc] initWithAuthState:authState
  27. error:nil
  28. emmSupport:nil
  29. profileData:profileData];
  30. XCTAssertNotNil(authFlow);
  31. XCTAssertEqual(authFlow.authState, authState);
  32. XCTAssertNil(authFlow.error);
  33. XCTAssertNil(authFlow.emmSupport);
  34. XCTAssertEqual(authFlow.profileData, profileData);
  35. }
  36. - (void)testInit {
  37. GIDAuthFlow *authFlow = [[GIDAuthFlow alloc] init];
  38. XCTAssertNotNil(authFlow);
  39. XCTAssertNil(authFlow.authState);
  40. XCTAssertNil(authFlow.error);
  41. XCTAssertNil(authFlow.emmSupport);
  42. XCTAssertNil(authFlow.profileData);
  43. }
  44. @end