示例#1
0
        public User CreateFrom(GooglePlusUser googleUser)
        {
            var user = new User();

            Map(googleUser, user);

            return user;
        }
示例#2
0
 public void Map(GooglePlusUser googleUser, User user)
 {
     if (googleUser.Name != null)
     {
         user.FirstName = googleUser.Name.GivenName;
         user.LastName = googleUser.Name.FamilyName;
         user.GoogleId = googleUser.Id;
     }
 }
示例#3
0
        public void Should_return_object_from_service()
        {
            GooglePlusUser serviceResult = new GooglePlusUser();

            jsonClient.Setup(c => c.GetData<GooglePlusUser>(It.IsAny<string>())).Returns(serviceResult);

            GooglePlusUser providerResult = target.GetProfile("1");

            Assert.AreSame(serviceResult, providerResult);
        }