Пример #1
0
        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);
        }
Пример #2
0
        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);
            });
        }
Пример #3
0
        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));
            });
        }
Пример #4
0
 public void SetAddressFromTweet(TweetDbo tweet)
 {
     _tweetDboAddressCleanHandler.Handle(tweet);
 }