Пример #1
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;
     }
 }
Пример #2
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");
        }
Пример #3
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");
 }