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

            Map(googleUser, user);

            return user;
        }
Beispiel #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;
     }
 }
Beispiel #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);
        }