Esempio n. 1
0
        public void a_url_with_extra_query_string_parameters_will_match()
        {
            var template = new OpenRasta.UriTemplate("/test?q={searchTerm}&p={pageNumber}&s={pageSize}");

            OpenRasta.UriTemplateMatch match = template.Match(new Uri("http://localhost/"), new Uri("http://localhost/test?q=test&p=1&s=10&contentType=json"));
            match.ShouldNotBeNull();
        }
Esempio n. 2
0
        public void a_url_matching_result_in_the_query_value_variable_being_set()
        {
            var table = new OpenRasta.UriTemplate("/test?query={queryValue}");

            OpenRasta.UriTemplateMatch match = table.Match(new Uri("http://localhost"), new Uri("http://localhost/test?query=search"));

            match.ShouldNotBeNull();

            match.BoundQueryParameters["queryValue"].ShouldBe("search");
        }
Esempio n. 3
0
        public void a_url_matching_three_query_string_parameters_will_match()
        {
            var table = new OpenRasta.UriTemplate("/test?q={searchTerm}&p={pageNumber}&s={pageSize}");

            OpenRasta.UriTemplateMatch match = table.Match(new Uri("http://localhost"), new Uri("http://localhost/test?q=&p=1&s=10"));
            match.ShouldNotBeNull();
            match.BoundQueryParameters["searchTerm"].ShouldBe(string.Empty);
            match.BoundQueryParameters["pageNumber"].ShouldBe("1");
            match.BoundQueryParameters["pageSize"].ShouldBe("10");
        }
Esempio n. 4
0
        public void a_template_on_the_root_gets_a_match()
        {
            GivenAMatching("/", "http://localhost/");

            ThenTheMatch.ShouldNotBeNull();
        }