public async Task <TweetDbo> AssignAddressObjectToTweet(TweetDbo tweetDbo, CancellationToken cancellationToken = default) { var geocode = await _gmapsGeocodeClient.GetGeocodeForAddress(tweetDbo.AddressText, cancellationToken); var geocodeDbo = _mapper.Map <GeocodeDbo>(geocode); tweetDbo.Geocode = geocodeDbo; return(tweetDbo); }
public void Should_Get_Address_String() { Assert.All(ConstantsTestData.AddressTweets, x => { var tweet = new TweetDbo { Text = x.Item1.Replace("\r", "") }; _fixture.AddressCleanService.SetAddressFromTweet(tweet); Assert.Equal(x.Item2, tweet.AddressText); }); }
public void Should_Not_Be_Empty_Or_Null_String() { Assert.All(ConstantsTestData.AddressTweets, x => { var tweet = new TweetDbo { Text = x.Item1.Replace("\r", "") }; _fixture.AddressCleanService.SetAddressFromTweet(tweet); Assert.NotNull(tweet.AddressText); Assert.False(string.IsNullOrEmpty(tweet.AddressText)); }); }
public void SetAddressFromTweet(TweetDbo tweet) { _tweetDboAddressCleanHandler.Handle(tweet); }