private bool Test(string expected, HttpContent actual) { var sut = new FormDataMatcher(expected); return(sut.Matches(new HttpRequestMessage(HttpMethod.Get, "http://tempuri.org/home") { Content = actual })); }
private bool Test(string expected, string actual) { var sut = new FormDataMatcher(expected); FormUrlEncodedContent content = new FormUrlEncodedContent( HttpHelpers.ParseQueryString(actual) ); return(sut.Matches(new HttpRequestMessage(HttpMethod.Get, "http://tempuri.org/home") { Content = content })); }
public void Should_support_matching_dictionary_data_with_url_encoded_values2() { var data = new Dictionary <string, string>(); data.Add("key", "Value with spaces"); var content = new FormUrlEncodedContent(data); var sut = new FormDataMatcher("key=Value+with%20spaces"); var actualMatch = sut.Matches(new HttpRequestMessage(HttpMethod.Get, "http://tempuri.org/home") { Content = content }); Assert.True(actualMatch, "FormDataMatcher.Matches() should match dictionary data with URL encoded query string values."); }