Ejemplo n.º 1
0
 public async void GetGoogleUserWithoutLocation()
 {
     // Arrange
     var placesLived = _googleUserData.PlacesLived;
     _googleUserData.PlacesLived = new GoogleUserData.GoogleLocation[]{ };//Delete location from googleacc
     var expectedUser = Mapper.Map(_googleUserData, new User());
     // Act
     var provider = new GoogleAccountProvider(_webRequest, new UserCredential
     {
         SocialNetworkId = _userId,
         AccessToken = _accessToken
     });
     var user = await provider.GetUserInfoAsync();
     // Assert
     user.ToString().Should().Be(expectedUser.ToString());
     _googleUserData.PlacesLived = placesLived;
 }
Ejemplo n.º 2
0
 public async void GetGoogleUserWithOnlyCity()
 {
     // Arrange
     var placesLived = _googleUserData.PlacesLived;
     _googleUserData.PlacesLived[0].Value = _googleUserData.PlacesLived[0].Value.Split(", ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[0];
     var expectedUser = Mapper.Map(_googleUserData, new User());
     expectedUser.Timezone = _googleTimeZone.RawOffset / 3600;
     // Act
     var provider = new GoogleAccountProvider(_webRequest, new UserCredential
     {
         SocialNetworkId = _userId,
         AccessToken = _accessToken
     });
     var user = await provider.GetUserInfoAsync();
     // Assert
     user.ToString().Should().Be(expectedUser.ToString());
     _googleUserData.PlacesLived = placesLived;
 }
Ejemplo n.º 3
0
 public async void Get_Google_User_Data()
 {
     // Arrange
     var expectedUser = Mapper.Map(_googleUserData, new User());
     expectedUser.Timezone = _googleTimeZone.RawOffset/3600;
     // Act
     var provider = new GoogleAccountProvider(_webRequest, new UserCredential
     {
         SocialNetworkId = _userId,
         AccessToken = _accessToken
     });
     var user = await provider.GetUserInfoAsync();
     // Assert
     user.ToString().Should().Be(expectedUser.ToString());
 }