public void Yahoo_PlaceFinder_PlaceFinderClient_FindByFullyParsedAddress_ShouldThrowException_WhenArgIsNull()
 {
     using (var client = new PlaceFinderClient())
     {
         client.Find(null as PlaceByFullyParsedAddress);
     }
 }
 public void Yahoo_PlaceFinder_PlaceFinderClient_FindByCoordinates_ShouldThrowException_WhenArgIsNull()
 {
     using (var client = new PlaceFinderClient())
     {
         client.Find(null as PlaceByCoordinates);
     }
 }
 public void Yahoo_PlaceFinder_PlaceFinderClient_FindByWoeId_ShouldThrowException_WhenArgIsNull()
 {
     using (var client = new PlaceFinderClient())
     {
         client.Find(null as PlaceByWoeId);
     }
 }
 public void Yahoo_PlaceFinder_PlaceFinderClient_FindByCoordinates_ShouldThrowException_WhenArgIsNull()
 {
     using (var client = new PlaceFinderClient())
     {
         client.Find(null as PlaceByCoordinates, ConsumerKey, ConsumerSecret);
     }
 }
 public void Yahoo_PlaceFinder_PlaceFinderClient_FindByCoordinates_ShouldNotThrowException_WhenWoeIdIsNull()
 {
     using (var client = new PlaceFinderClient())
     {
         var resultSet = client.Find(new PlaceByCoordinates(41.53531, -160.793358));
         resultSet.Results.Count.ShouldEqual(1);
         resultSet.Results[0].WoeId.ShouldBeNull();
         resultSet.Results[0].WoeType.ShouldBeNull();
     }
 }
 public void Yahoo_PlaceFinder_PlaceFinderClient_FindByCoordinates_ShouldNotThrowException_WhenWoeIdIsNull()
 {
     using (var client = new PlaceFinderClient())
     {
         var resultSet = client.Find(new PlaceByCoordinates(41.53531, -160.793358), ConsumerKey, ConsumerSecret);
         resultSet.Count.ShouldEqual(1);
         resultSet.Results[0].WoeId.ShouldBeNull();
         resultSet.Results[0].WoeType.ShouldBeNull();
     }
 }
        public void Yahoo_PlaceFinder_PlaceFinderClient_FindByFreeformText_ShouldReturn1Result_ForYahooExample()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("701 First Ave., Sunnyvale, CA 94089");

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_FindByFreeformText_ShouldReturn1Result_ForYahooExample()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("701 First Ave., Sunnyvale, CA 94089");

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_FindByName_ShouldReturn1Result_ForYahooExample()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByName("Yosemite National Park");

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_FindByMultilineAddress_ShouldReturn1Result_ForYahooExample1()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByMultilineAddress("701 First Ave.");

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_FindByCoordinates_ShouldReturn1Result_ForYahooExample()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByCoordinates(37.775391, 122.412209);

                var resultSet = client.Find(request);
                resultSet.ShouldNotBeNull();
                resultSet.Results.ShouldNotBeNull();
                resultSet.Results.Count.ShouldEqual(1);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_FindByMultilineAddress_ShouldReturn1Result_ForYahooExample1()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByMultilineAddress("701 First Ave.");

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldBeInRange(1, int.MaxValue);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_FindByWoeId_ShouldReturn1Result_ForYahooExample()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByWoeId(12797150);

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_FindByCoordinates_ShouldReturn1Result_ForYahooExample()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByCoordinates(37.775391, 122.412209);

                var resultSet = client.Find(request, ConsumerKey, ConsumerSecret);
                resultSet.ShouldNotBeNull();
                resultSet.Results.ShouldNotBeNull();
                resultSet.Count.ShouldEqual(1);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldOnlyFindExactMatches_WhenQuickModeIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("1426 Some Road")
                              .QuickMode();

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(7);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldReturnCrossStreets_WhenIncludeCrossStreetsIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("1600 Pennsylvania Avenue Washington, DC")
                              .IncludeCrossStreets();

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
                string.IsNullOrWhiteSpace(results.Results[0].CrossStreets).ShouldBeFalse();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldReturnNeighborhoods_WhenIncludeNeighborhoodsIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                              .IncludeNeighborhoods();

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
                string.IsNullOrWhiteSpace(results.Results[0].Neighborhood).ShouldBeFalse();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldReturnWoeId_WhenExcludeWoeIdIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                              .ExcludeWoeId();

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
                results.Results[0].WoeId.ShouldBeNull();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldReturnBoundingBox_WhenIncludeBoundingBoxIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                              .IncludeBoundingBox();

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
                results.Results[0].BoundingBox.ShouldNotBeNull();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldReturnTimeZone_WhenIncludeTimeZoneIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                              .IncludeTimeZone();

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
                results.Results[0].TimeZone.ShouldNotBeNull();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldReturnCoordinateDataOnly_WhenCoordinateDataOnlyIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                              .ReturnCoordinateDataOnly();

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
                results.Results[0].CityName.ShouldBeNull();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldReturnGlobalElements_WhenReturnGlobalElementsIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                              .ReturnGlobalElements();

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
                results.Results[0].CityName.ShouldBeNull();
                results.Results[0].Level3Name.ShouldEqual(request.Location);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldNotReturnCrossStreets_WhenIncludeCrossStreetsIsInvoked_WithFalseArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("1600 Pennsylvania Avenue Washington, DC")
                              .IncludeCrossStreets()
                              .IncludeCrossStreets(false);

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
                results.Results[0].CrossStreets.ShouldBeNull();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldNotReturnWoeId_WhenExcludeWoeIdIsInvoked_WithFalseArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                              .ExcludeWoeId()
                              .ExcludeWoeId(false);

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
                results.Results[0].WoeId.HasValue.ShouldBeTrue();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldNotReturnTelephoneAreaCode_WhenIncludeTelephoneAreaCodeIsInvoked_WithFalseArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                              .IncludeTelephoneAreaCode()
                              .IncludeTelephoneAreaCode(false);

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
                results.Results[0].AreaCode.ShouldBeNull();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldNotReturnCoordinateDataOnly_WhenCoordinateDataOnlyIsInvoked_WithFalseArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                              .ReturnCoordinateDataOnly()
                              .ReturnCoordinateDataOnly(false);

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
                results.Results[0].CityName.ShouldEqual(request.Location);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldEnsureStreetDetailFlagIsRemoved()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByName("Eiffel Tower")
                {
                    Flags = new HashSet <Flag>
                    {
                        Flag.StreetDetail,
                    }
                };

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                request.Flags.ShouldNotContain(Flag.StreetDetail);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldEnsurePhpFlagIsRemoved()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByName("Great Pyramids")
                {
                    Flags = new HashSet <Flag>
                    {
                        Flag.Php,
                    }
                };

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                request.Flags.ShouldNotContain(Flag.Php);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldLimitResultsToLocaleCountry_WhenLimitResultsToLocaleCountryIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Paris")
                {
                    Locale = "en-US",
                    Count  = 50,
                }
                .LimitResultsToLocaleCountry();

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldBeInRange(1, 50);
                results.Results.ToList().ForEach(result => result.CountryCode.ShouldEqual("US"));
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldNotLimitResultsToLocaleCountry_WhenLimitResultsToLocaleCountryIsInvoked_WithFalseArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Paris")
                {
                    Locale = "en-US",
                }
                .LimitResultsToLocaleCountry()
                .LimitResultsToLocaleCountry(false);

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
                results.Results[0].CountryCode.ShouldEqual("FR");
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_FindBFullyParsedAddress_ShouldReturn1Result_ForYahooExample1()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFullyParsedAddress
                {
                    House = "701",
                    Street = "First Ave.",
                    Postal = "94089",
                    City = "Sunnyvale",
                    County = "Santa Clara",
                    StateOrProvince = "CA",
                    Country = "USA",
                };

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_FindBFullyParsedAddress_ShouldReturn1Result_ForYahooExample1()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFullyParsedAddress
                {
                    House           = "701",
                    Street          = "First Ave.",
                    Postal          = "94089",
                    City            = "Sunnyvale",
                    County          = "Santa Clara",
                    StateOrProvince = "CA",
                    Country         = "USA",
                };

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldReturnCrossStreets_WhenIncludeCrossStreetsIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("1600 Pennsylvania Avenue Washington, DC")
                    .IncludeCrossStreets();

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
                string.IsNullOrWhiteSpace(results.Results[0].CrossStreets).ShouldBeFalse();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldReturnCoordinateDataOnly_WhenCoordinateDataOnlyIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                    .ReturnCoordinateDataOnly();

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
                results.Results[0].CityName.ShouldBeNull();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldOnlyFindExactMatches_WhenQuickModeIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("1426 Some Road")
                    .QuickMode();

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(7);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldNotReturnCoordinateDataOnly_WhenCoordinateDataOnlyIsInvoked_WithFalseArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                    .ReturnCoordinateDataOnly()
                    .ReturnCoordinateDataOnly(false);

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
                results.Results[0].CityName.ShouldEqual(request.Location);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldNotReturnTelephoneAreaCode_WhenIncludeTelephoneAreaCodeIsInvoked_WithFalseArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                    .IncludeTelephoneAreaCode()
                    .IncludeTelephoneAreaCode(false);

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
                results.Results[0].AreaCode.ShouldBeNull();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldNotLimitResultsToLocaleCountry_WhenLimitResultsToLocaleCountryIsInvoked_WithFalseArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Paris")
                {
                    Locale = "en-US",
                }
                .LimitResultsToLocaleCountry()
                .LimitResultsToLocaleCountry(false);

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
                results.Results[0].CountryCode.ShouldEqual("FR");
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldReturnBoundingBox_WhenIncludeBoundingBoxIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                    .IncludeBoundingBox();

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
                results.Results[0].BoundingBox.ShouldNotBeNull();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldNotReturnCrossStreets_WhenIncludeCrossStreetsIsInvoked_WithFalseArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("1600 Pennsylvania Avenue Washington, DC")
                    .IncludeCrossStreets()
                    .IncludeCrossStreets(false);

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
                results.Results[0].CrossStreets.ShouldBeNull();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldReturnWoeId_WhenExcludeWoeIdIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                    .ExcludeWoeId();

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
                results.Results[0].WoeId.ShouldBeNull();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldReturnNeighborhoods_WhenIncludeNeighborhoodsIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                    .IncludeNeighborhoods();

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
                string.IsNullOrWhiteSpace(results.Results[0].Neighborhood).ShouldBeFalse();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_FindByWoeId_ShouldReturn1Result_ForYahooExample()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByWoeId(12797150);

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_FindByName_ShouldReturn1Result_ForYahooExample()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByName("Yosemite National Park");

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
            }
        }
 public void Yahoo_PlaceFinder_PlaceFinderClient_FindByMultilineAddress_ShouldThrowException_WhenArgIsNull()
 {
     using (var client = new PlaceFinderClient())
     {
         client.Find(null as PlaceByMultilineAddress);
     }
 }
        public void Yahoo_PlaceFinder_PlaceFinderClient_FindByMultilineAddress_ShouldReturn1Result_ForYahooExample1()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByMultilineAddress("701 First Ave.");

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldLimitResultsToLocaleCountry_WhenLimitResultsToLocaleCountryIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Paris")
                {
                    Locale = "en-US",
                    Count = 100
                }
                .LimitResultsToLocaleCountry();

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldBeInRange(1, 100);
                results.Results.ToList().ForEach(result => result.CountryCode.ShouldEqual("US"));
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldReturnGlobalElements_WhenReturnGlobalElementsIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                    .ReturnGlobalElements();

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
                results.Results[0].CityName.ShouldBeNull();
                results.Results[0].Level3Name.ShouldEqual(request.Location);
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldNotReturnWoeId_WhenExcludeWoeIdIsInvoked_WithFalseArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                    .ExcludeWoeId()
                    .ExcludeWoeId(false);

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldEqual(1);
                results.Results[0].WoeId.HasValue.ShouldBeTrue();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldReturnTimeZone_WhenIncludeTimeZoneIsInvoked_WithNoArg()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByFreeformText("Atlanta")
                    .IncludeTimeZone();

                var results = client.Find(request);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Results.Count.ShouldEqual(1);
                results.Results[0].TimeZone.ShouldNotBeNull();
            }
        }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldEnsurePhpFlagIsRemoved()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByName("Great Pyramids")
                {
                    Flags = new HashSet<Flag>
                    {
                        Flag.Php,
                    }
                };

                var results = client.Find(request);
                results.ShouldNotBeNull();
                request.Flags.ShouldNotContain(Flag.Php);
            }
        }
 public void Yahoo_PlaceFinder_PlaceFinderClient_FindByWoeId_ShouldThrowException_WhenArgIsNull()
 {
     using (var client = new PlaceFinderClient())
     {
         client.Find(null as PlaceByWoeId, ConsumerKey, ConsumerSecret);
     }
 }
        public void Yahoo_PlaceFinder_PlaceFinderClient_ShouldEnsureStreetDetailFlagIsRemoved()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByName("Eiffel Tower")
                {
                    Flags = new HashSet<Flag>
                    {
                        Flag.StreetDetail,
                    }
                };

                var results = client.Find(request);
                results.ShouldNotBeNull();
                request.Flags.ShouldNotContain(Flag.StreetDetail);
            }
        }
 public void Yahoo_PlaceFinder_PlaceFinderClient_FindByFreeformText_ShouldThrowException_WhenArgIsNull()
 {
     using (var client = new PlaceFinderClient())
     {
         client.Find(null as PlaceByFreeformText);
     }
 }
        public void Yahoo_PlaceFinder_PlaceFinderClient_FindByMultilineAddress_ShouldReturn1Result_ForYahooExample1()
        {
            using (var client = new PlaceFinderClient())
            {
                var request = new PlaceByMultilineAddress("701 First Ave.");

                var results = client.Find(request, ConsumerKey, ConsumerSecret);
                results.ShouldNotBeNull();
                results.Results.ShouldNotBeNull();
                results.Count.ShouldBeInRange(1, int.MaxValue);
            }
        }