public User CreateFrom(GooglePlusUser googleUser) { var user = new User(); Map(googleUser, user); return user; }
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; } }
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); }