blob: 4f3d4d3c7f0bbdd48fcebbabc2d82cbb42cb3f50 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/web_view/public/cwv_identity.h"
#import <Foundation/Foundation.h>
#include "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace ios_web_view {
using CWVIdentityTest = PlatformTest;
// Tests CWVIdentity initialization.
TEST_F(CWVIdentityTest, Initialization) {
NSString* email = @"john.doe@chromium.org";
NSString* full_name = @"John Doe";
NSString* gaia_id = @"123456789";
CWVIdentity* identity = [[CWVIdentity alloc] initWithEmail:email
fullName:full_name
gaiaID:gaia_id];
EXPECT_NSEQ(email, identity.email);
EXPECT_NSEQ(full_name, identity.fullName);
EXPECT_NSEQ(gaia_id, identity.gaiaID);
}
} // namespace ios_web_view