public void Can_append_query_param_to_template_with_query_continuation() { // given UriTemplateString template = "/static/path?required={required}{&opt}"; // when var newTemplate = template.AppendQueryParam("query"); // then newTemplate.ToString().Should().Be("/static/path?required={required}{&opt,query}"); }
public void Can_append_exploded_query_param_to_template_with_mandatory_query_parameter() { // given UriTemplateString template = "/static/path?required={required}"; // when var newTemplate = template.AppendQueryParam("query", true); // then newTemplate.ToString().Should().Be("/static/path?required={required}{&query*}"); }
public void Can_append_exploded_query_param_to_literal_template() { // given UriTemplateString template = "/some/path"; // when var newTemplate = template.AppendQueryParam("query", true); // then newTemplate.ToString().Should().Be("/some/path{?query*}"); }
public void Can_append_regular_query_param_to_existing_query() { // given UriTemplateString template = "/some/path{?title}"; // when var newTemplate = template.AppendQueryParam("query"); // then newTemplate.ToString().Should().Be("/some/path{?title,query}"); }
public void Concatenating_template_empty_string_with_Should_not_change_it() { // given var template = new UriTemplateString("{controller}{/action}"); // when var concatenated = template + string.Empty; // then concatenated.Should().Be(template); }
public void Is_castable_from_string() { // given const string strVal = "/some/simple/path"; // when UriTemplateString template = strVal; // then template.ToString().Should().Be(strVal); }
public void Should_concatenate_two_templates() { // given var left = new UriTemplateString("http://example.com/{area}/"); var right = new UriTemplateString("{controller}{/action}"); // when var concat = left + right; // then concat.ToString().Should().Be("http://example.com/{area}/{controller}{/action}"); }
public void Can_append_regular_query_param_to_template_ending_with_non_query_expression( string templateBefore, string templateAfter) { // given UriTemplateString template = templateBefore; // when var newTemplate = template.AppendQueryParam("params"); // then newTemplate.ToString().Should().Be(templateAfter); }