public void op_FromString_string() { var expected = new HttpRequestLine("GET", "http://example.com/", "HTTP/1.1"); var actual = HttpRequestLine.FromString("GET http://example.com/ HTTP/1.1"); Assert.Equal(expected, actual); }
public void opImplicit_string_RequestLine() { const string expected = "GET http://example.com/ HTTP/1.1"; string actual = new HttpRequestLine("GET", "http://example.com/"); Assert.Equal(expected, actual); }
public void op_ToString() { const string expected = "GET http://example.com/ HTTP/1.0"; var actual = new HttpRequestLine("GET", "http://example.com/", "HTTP/1.0").ToString(); Assert.Equal(expected, actual); }
public void op_FromString_string_whenUriMissing() { Assert.Throws <UriFormatException>(() => HttpRequestLine.FromString("GET HTTP/1.1")); }
public void op_FromString_string_whenMethodMissing() { Assert.Throws <FormatException>(() => HttpRequestLine.FromString("http://example.com/ HTTP/1.1")); }
public void op_FromString_stringNull() { Assert.Throws <ArgumentNullException>(() => HttpRequestLine.FromString(null)); }
public void op_FromString_stringEmpty() { Assert.Throws <ArgumentOutOfRangeException>(() => HttpRequestLine.FromString(string.Empty)); }