public void Yahoo_PlaceFinder_PlaceByFreeformText_ShouldConstructWithLatitudeAndLongitude()
        {
            var it = new PlaceByFreeformText("free form text");

            it.ShouldNotBeNull();
            it.Location.ShouldEqual("free form text");
        }
Beispiel #2
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_IncludeBoundingBox_ShouldAddBoundingBoxFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").IncludeBoundingBox();

            it.ShouldNotBeNull();
            it.Flags.ShouldContain(Flag.BoundingBox);
        }
Beispiel #3
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_IncludeNeighborhoods_ShouldAddNeighborhoodsGFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").IncludeNeighborhoods();

            it.ShouldNotBeNull();
            it.GFlags.ShouldContain(GFlag.Neighborhoods);
        }
        public void Yahoo_PlaceFinder_PlaceByFreeformText_ShouldAllowLocationToBeChanged_AfterConstruction()
        {
            var it = new PlaceByFreeformText("free form text") { Location = "other free form text" };

            it.ShouldNotBeNull();
            it.Location.ShouldEqual("other free form text");
        }
        public void Yahoo_PlaceFinder_PlaceByExtensions_IncludeBoundingBox_ShouldAddBoundingBoxFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").IncludeBoundingBox();

            it.ShouldNotBeNull();
            it.Flags.ShouldContain(Flag.BoundingBox);
        }
Beispiel #6
0
 private Response ChannelFindByFreeformText(PlaceByFreeformText request, int retry = 0)
 {
     try
     {
         return(Channel.FindByFreeformText(request.Location, request.Locale,
                                           request.Start, request.Count, request.Offset,
                                           request.GetFlagsAsString(), request.GetGFlagsAsString(),
                                           request.AppId));
     }
     catch (ProtocolException ex)
     {
         if (retry < RetryLimit && ex.InnerException is WebException)
         {
             return(ChannelFindByFreeformText(request, ++retry));
         }
         throw;
     }
     catch (CommunicationException ex)
     {
         if (retry < RetryLimit && ex.Message == "Server Error")
         {
             return(ChannelFindByFreeformText(request, ++retry));
         }
         throw;
     }
 }
        public void Yahoo_PlaceFinder_PlaceByExtensions_IncludeCrossStreets_ShouldAddCrossStreetsGFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").IncludeCrossStreets();

            it.ShouldNotBeNull();
            it.GFlags.ShouldContain(GFlag.CrossStreets);
        }
Beispiel #8
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_LimitResultsToLocaleCountry_ShouldAddLimitToLocaleCountryGFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").LimitResultsToLocaleCountry();

            it.ShouldNotBeNull();
            it.GFlags.ShouldContain(GFlag.LimitToLocaleCountry);
        }
Beispiel #9
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_QuickMode_ShouldAddQuickModeGFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").QuickMode();

            it.ShouldNotBeNull();
            it.GFlags.ShouldContain(GFlag.QuickMode);
        }
Beispiel #10
0
 private static BossResponse OAuthFind(PlaceByFreeformText request, string consumerKey, string consumerSecret, int retry = 0)
 {
     try
     {
         using (var oAuth = new OAuthClient())
         {
             var json          = oAuth.Get(request.GetUri(), consumerKey, consumerSecret);
             var bossContainer = JsonConvert.DeserializeObject <BossContainer>(json);
             if (bossContainer != null)
             {
                 return(bossContainer.BossResponse);
             }
             throw new InvalidOperationException("Unable to parse BOSS GEO Response. Raw JSON:\r\n" + json);
         }
     }
     catch (ProtocolException ex)
     {
         if (retry < RetryLimit && ex.InnerException is WebException)
         {
             return(OAuthFind(request, consumerKey, consumerSecret, ++retry));
         }
         throw;
     }
     catch (CommunicationException ex)
     {
         if (retry < RetryLimit && ex.Message == "Server Error")
         {
             return(OAuthFind(request, consumerKey, consumerSecret, ++retry));
         }
         throw;
     }
 }
        public void Yahoo_PlaceFinder_PlaceByExtensions_IncludeAirportCode_ShouldAddAirportFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").IncludeAirportCode();

            it.ShouldNotBeNull();
            it.Flags.ShouldContain(Flag.Airport);
        }
Beispiel #12
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_ReturnCoordinateDataOnly_ShouldAddCoordinateDataOnlyFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").ReturnCoordinateDataOnly();

            it.ShouldNotBeNull();
            it.Flags.ShouldContain(Flag.CoordinateDataOnly);
        }
Beispiel #13
0
        public void Yahoo_PlaceFinder_PlaceByFreeformText_ShouldConstructWithLatitudeAndLongitude()
        {
            var it = new PlaceByFreeformText("free form text");

            it.ShouldNotBeNull();
            it.Location.ShouldEqual("free form text");
        }
        public void Yahoo_PlaceFinder_PlaceByExtensions_ExcludeWoeId_ShouldAddNoWoeIdFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").ExcludeWoeId();

            it.ShouldNotBeNull();
            it.Flags.ShouldContain(Flag.NoWoeId);
        }
Beispiel #15
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_IncludeTimeZone_ShouldAddTimeZoneFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").IncludeTimeZone();

            it.ShouldNotBeNull();
            it.Flags.ShouldContain(Flag.TimeZone);
        }
Beispiel #16
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_IncludeAirportCode_ShouldAddAirportFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").IncludeAirportCode();

            it.ShouldNotBeNull();
            it.Flags.ShouldContain(Flag.Airport);
        }
Beispiel #17
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_ReturnGlobalElements_ShouldAddGlobalFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").ReturnGlobalElements();

            it.ShouldNotBeNull();
            it.Flags.ShouldContain(Flag.Global);
        }
Beispiel #18
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_IncludeCrossStreets_ShouldAddCrossStreetsGFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").IncludeCrossStreets();

            it.ShouldNotBeNull();
            it.GFlags.ShouldContain(GFlag.CrossStreets);
        }
Beispiel #19
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_ExcludeWoeId_ShouldAddNoWoeIdFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").ExcludeWoeId();

            it.ShouldNotBeNull();
            it.Flags.ShouldContain(Flag.NoWoeId);
        }
        public ResultSet Find(PlaceByFreeformText request, string consumerKey, string consumerSecret)
        {
            if (request == null) throw new ArgumentNullException("request");
            EnsureContractsAreSatisfied(request);

            var response = OAuthFind(request, consumerKey, consumerSecret);
            return response.PlaceFinder;
        }
Beispiel #21
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_ReturnCoordinateDataOnly_ShouldDoNothing_WhenArgIsFalse_AndCoordinateDataOnlyFlagIsNotPresent()
        {
            var it = new PlaceByFreeformText("text")
                     .ReturnCoordinateDataOnly(false);

            it.ShouldNotBeNull();
            it.Flags.ShouldNotContain(Flag.CoordinateDataOnly);
        }
Beispiel #22
0
 public void ExtensionMethod_ApplyDefaultValues_ShouldApplyDefaultValueAttributes()
 {
     var request = new PlaceByFreeformText("test");
     request.ApplyDefaultValues();
     request.Locale.ShouldEqual("en-US");
     request.Start.ShouldEqual(0);
     request.Count.ShouldEqual(10);
     request.Offset.ShouldEqual(15);
 }
Beispiel #23
0
        public void Yahoo_PlaceFinder_PlaceBy_ShouldSerializeGFlags()
        {
            var request = new PlaceByFreeformText("text");

            request.GFlags.Add(GFlag.QuickMode);
            request.GFlags.Add(GFlag.LimitToLocaleCountry);
            var flags = request.GetGFlagsAsString();

            flags.ShouldEqual("QL");
        }
Beispiel #24
0
        public void Yahoo_PlaceFinder_PlaceByFreeformText_ShouldAllowLocationToBeChanged_AfterConstruction()
        {
            var it = new PlaceByFreeformText("free form text")
            {
                Location = "other free form text"
            };

            it.ShouldNotBeNull();
            it.Location.ShouldEqual("other free form text");
        }
        public void Yahoo_PlaceFinder_PlaceByExtensions_ExcludeWoeId_ShouldRemoveNoWoeIdFlag_WhenArgIsFalse()
        {
            var it = new PlaceByFreeformText("text")
            {
                Flags = new HashSet<Flag> { Flag.NoWoeId }
            }
            .ExcludeWoeId(false);

            it.ShouldNotBeNull();
            it.Flags.ShouldNotContain(Flag.NoWoeId);
        }
        public void Yahoo_PlaceFinder_PlaceByExtensions_IncludeBoundingBox_ShouldRemoveBoundingBoxFlag_WhenArgIsFalse()
        {
            var it = new PlaceByFreeformText("text")
            {
                Flags = new HashSet<Flag> { Flag.BoundingBox }
            }
            .IncludeBoundingBox(false);

            it.ShouldNotBeNull();
            it.Flags.ShouldNotContain(Flag.BoundingBox);
        }
        public void Yahoo_PlaceFinder_PlaceByExtensions_IncludeAirportCode_ShouldRemoveAirportFlag_WhenArgIsFalse()
        {
            var it = new PlaceByFreeformText("text")
            {
                Flags = new HashSet<Flag> { Flag.Airport }
            }
            .IncludeAirportCode(false);

            it.ShouldNotBeNull();
            it.Flags.ShouldNotContain(Flag.Airport);
        }
Beispiel #28
0
        public ResultSet Find(PlaceByFreeformText request)
        {
            if (request == null)
            {
                throw new ArgumentNullException("request");
            }
            EnsureContractsAreSatisfied(request);

            var response = ChannelFindByFreeformText(request);

            return(response.ResultSet);
        }
        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_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);
            }
        }
Beispiel #31
0
        public ResultSet Find(PlaceByFreeformText request, string consumerKey, string consumerSecret)
        {
            if (request == null)
            {
                throw new ArgumentNullException("request");
            }
            EnsureContractsAreSatisfied(request);

            var response = OAuthFind(request, consumerKey, consumerSecret);

            return(response.PlaceFinder);
        }
Beispiel #32
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_ReturnCoordinateDataOnly_ShouldRemoveCoordinateDataOnlyFlag_WhenArgIsFalse()
        {
            var it = new PlaceByFreeformText("text")
            {
                Flags = new HashSet <Flag> {
                    Flag.CoordinateDataOnly
                }
            }
            .ReturnCoordinateDataOnly(false);

            it.ShouldNotBeNull();
            it.Flags.ShouldNotContain(Flag.CoordinateDataOnly);
        }
        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);
            }
        }
Beispiel #34
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_LimitResultsToLocaleCountry_ShouldRemoveLimitToLocaleCountryGFlag_WhenArgIsFalse()
        {
            var it = new PlaceByFreeformText("text")
            {
                GFlags = new HashSet <GFlag> {
                    GFlag.LimitToLocaleCountry
                }
            }
            .LimitResultsToLocaleCountry(false);

            it.ShouldNotBeNull();
            it.GFlags.ShouldNotContain(GFlag.LimitToLocaleCountry);
        }
Beispiel #35
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_QuickMode_ShouldRemoveQuickModeGFlag_WhenArgIsFalse()
        {
            var it = new PlaceByFreeformText("text")
            {
                GFlags = new HashSet <GFlag> {
                    GFlag.QuickMode
                }
            }
            .QuickMode(false);

            it.ShouldNotBeNull();
            it.GFlags.ShouldNotContain(GFlag.QuickMode);
        }
Beispiel #36
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_ExcludeWoeId_ShouldRemoveNoWoeIdFlag_WhenArgIsFalse()
        {
            var it = new PlaceByFreeformText("text")
            {
                Flags = new HashSet <Flag> {
                    Flag.NoWoeId
                }
            }
            .ExcludeWoeId(false);

            it.ShouldNotBeNull();
            it.Flags.ShouldNotContain(Flag.NoWoeId);
        }
Beispiel #37
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_IncludeBoundingBox_ShouldRemoveBoundingBoxFlag_WhenArgIsFalse()
        {
            var it = new PlaceByFreeformText("text")
            {
                Flags = new HashSet <Flag> {
                    Flag.BoundingBox
                }
            }
            .IncludeBoundingBox(false);

            it.ShouldNotBeNull();
            it.Flags.ShouldNotContain(Flag.BoundingBox);
        }
Beispiel #38
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_IncludeTimeZone_ShouldRemoveTimeZoneFlag_WhenArgIsFalse()
        {
            var it = new PlaceByFreeformText("text")
            {
                Flags = new HashSet <Flag> {
                    Flag.TimeZone
                }
            }
            .IncludeTimeZone(false);

            it.ShouldNotBeNull();
            it.Flags.ShouldNotContain(Flag.TimeZone);
        }
Beispiel #39
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_IncludeCrossStreets_ShouldRemoveCrossStreetsGFlag_WhenArgIsFalse()
        {
            var it = new PlaceByFreeformText("text")
            {
                GFlags = new HashSet <GFlag> {
                    GFlag.CrossStreets
                }
            }
            .IncludeCrossStreets(false);

            it.ShouldNotBeNull();
            it.GFlags.ShouldNotContain(GFlag.CrossStreets);
        }
Beispiel #40
0
        public void Yahoo_PlaceFinder_PlaceByExtensions_ReturnGlobalElements_ShouldRemoveGlobalFlag_WhenArgIsFalse()
        {
            var it = new PlaceByFreeformText("text")
            {
                Flags = new HashSet <Flag> {
                    Flag.Global
                }
            }
            .ReturnGlobalElements(false);

            it.ShouldNotBeNull();
            it.Flags.ShouldNotContain(Flag.Global);
        }
        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_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_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_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_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_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_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_PlaceByExtensions_ReturnGlobalElements_ShouldRemoveGlobalFlag_WhenArgIsFalse()
        {
            var it = new PlaceByFreeformText("text")
            {
                Flags = new HashSet<Flag> { Flag.Global }
            }
            .ReturnGlobalElements(false);

            it.ShouldNotBeNull();
            it.Flags.ShouldNotContain(Flag.Global);
        }
        public void Yahoo_PlaceFinder_PlaceByExtensions_ReturnGlobalElements_ShouldAddGlobalFlag_WhenNoArgIsSpecified()
        {
            var it = new PlaceByFreeformText("text").ReturnGlobalElements();

            it.ShouldNotBeNull();
            it.Flags.ShouldContain(Flag.Global);
        }
        public void Yahoo_PlaceFinder_PlaceByExtensions_IncludeCrossStreets_ShouldRemoveCrossStreetsGFlag_WhenArgIsFalse()
        {
            var it = new PlaceByFreeformText("text")
            {
                GFlags = new HashSet<GFlag> { GFlag.CrossStreets }
            }
            .IncludeCrossStreets(false);

            it.ShouldNotBeNull();
            it.GFlags.ShouldNotContain(GFlag.CrossStreets);
        }
        public void Yahoo_PlaceFinder_PlaceByExtensions_ReturnCoordinateDataOnly_ShouldRemoveCoordinateDataOnlyFlag_WhenArgIsFalse()
        {
            var it = new PlaceByFreeformText("text")
            {
                Flags = new HashSet<Flag> { Flag.CoordinateDataOnly }
            }
            .ReturnCoordinateDataOnly(false);

            it.ShouldNotBeNull();
            it.Flags.ShouldNotContain(Flag.CoordinateDataOnly);
        }
        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_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_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_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_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_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_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_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();
            }
        }