public void Should_parse_any_casing() { Assert.That(HttpMethodHelpers.Parse("Get"), Is.EqualTo(HttpMethod.Get)); Assert.That(HttpMethodHelpers.Parse("post"), Is.EqualTo(HttpMethod.Post)); Assert.That(HttpMethodHelpers.Parse("pUT"), Is.EqualTo(HttpMethod.Put)); Assert.That(HttpMethodHelpers.Parse("DeLeTe"), Is.EqualTo(HttpMethod.Delete)); }
public void Should_parse_all_supported_http_methods() { Assert.That(HttpMethodHelpers.Parse("GET"), Is.EqualTo(HttpMethod.Get)); Assert.That(HttpMethodHelpers.Parse("POST"), Is.EqualTo(HttpMethod.Post)); Assert.That(HttpMethodHelpers.Parse("PUT"), Is.EqualTo(HttpMethod.Put)); Assert.That(HttpMethodHelpers.Parse("DELETE"), Is.EqualTo(HttpMethod.Delete)); }
public Request(SerializationInfo info, StreamingContext context) { Method = HttpMethodHelpers.Parse(info.GetString("Method")); Url = info.GetString("Url"); Body = (RequestPayload)info.GetValue("Body", typeof(RequestPayload)); Headers = (IDictionary <string, string>)info.GetValue("Headers", typeof(IDictionary <string, string>)); }
public void Should_not_parse_other_strings_as_http_method() { Assert.Throws <ArgumentException>(() => HttpMethodHelpers.Parse("")); Assert.Throws <ArgumentException>(() => HttpMethodHelpers.Parse("Soap")); Assert.Throws <ArgumentException>(() => HttpMethodHelpers.Parse("This is not a http method")); }
public void Should_parse_get() { var method = HttpMethodHelpers.Parse("GET"); Assert.That(method, Is.EqualTo(HttpMethod.Get)); }
public virtual IFluentApi <T> WithMethod(string methodName) { _requestData.HttpMethod = HttpMethodHelpers.Parse(methodName); return(this); }