Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
 public void op_FromString_string_whenUriMissing()
 {
     Assert.Throws <UriFormatException>(() => HttpRequestLine.FromString("GET HTTP/1.1"));
 }
Пример #5
0
 public void op_FromString_string_whenMethodMissing()
 {
     Assert.Throws <FormatException>(() => HttpRequestLine.FromString("http://example.com/ HTTP/1.1"));
 }
Пример #6
0
 public void op_FromString_stringNull()
 {
     Assert.Throws <ArgumentNullException>(() => HttpRequestLine.FromString(null));
 }
Пример #7
0
 public void op_FromString_stringEmpty()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => HttpRequestLine.FromString(string.Empty));
 }