Exemplo n.º 1
0
        public void When_building_an_url_with_empty_category()
        {
            var urlBuilder = new TweedehandsUrlBuilder();
            var url = urlBuilder.Build("nl_nl", null, "Test test");

            Assert.AreEqual("https://api.2dehands.com/pub/v1/nl_nl/arc/?price_minimum=0&price_maximum=0&sort_order=desc&sort_by=date&query=Test test&offset=0&limit=100&display_counts=0&display_result=1", url);
        }
        private QueryResult Query(string culture, string category, string value)
        {
            using (var client = new WebClient())
            {
                var url = new TweedehandsUrlBuilder().Build(culture, category, value);
                var rawQueryResult = client.DownloadString(url);

                return JsonConvert.DeserializeObject<QueryResult>(rawQueryResult);
            }
        }
Exemplo n.º 3
0
 public void When_building_an_url_with_empty_culture()
 {
     var urlBuilder = new TweedehandsUrlBuilder();
     var url = urlBuilder.Build(null, "Auto", "Test test");
 }