GIDVerifiableAccountDetailTest.m 1.0 KB

1234567891011121314151617181920212223242526272829
  1. #import <XCTest/XCTest.h>
  2. #import "GoogleSignIn/Sources/Public/GoogleSignIn/GIDVerifiableAccountDetail.h"
  3. @interface GIDVerifiableAccountDetailTests : XCTestCase
  4. @end
  5. @implementation GIDVerifiableAccountDetailTests
  6. - (void)testDesignatedInitializer {
  7. GIDVerifiableAccountDetail *detail = [[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:GIDAccountDetailTypeAgeOver18];
  8. XCTAssertNotNil(detail);
  9. XCTAssertEqual(detail.accountDetailType, GIDAccountDetailTypeAgeOver18);
  10. }
  11. - (void)testScopeRetrieval {
  12. GIDVerifiableAccountDetail *detail = [[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:GIDAccountDetailTypeAgeOver18];
  13. NSString *retrievedScope = [detail scope];
  14. XCTAssertEqualObjects(retrievedScope, kAccountDetailTypeAgeOver18Scope);
  15. }
  16. - (void)testScopeRetrieval_MissingScope {
  17. NSInteger missingScope = 5;
  18. GIDVerifiableAccountDetail *detail = [[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:missingScope];
  19. NSString *retrievedScope = [detail scope];
  20. XCTAssertNil(retrievedScope);
  21. }
  22. @end