public void ParsedRequestShouldMatchTheOriginalRequest()
        {
            var requestParser = new RegexRequestParser();

            var request = requestParser.Parse(Request);

            Assert.AreEqual(Request, request.ToString());
        }
        public void ShouldParseMethodPathAndBody()
        {
            var requestParser = new RegexRequestParser();

            var request = requestParser.Parse(Request);

            Assert.AreEqual("GET", request.Method);
            Assert.AreEqual("/test/route", request.Path);
            Assert.AreEqual("body", request.Body);
        }
        public void ShouldAddAllHeaders()
        {
            var requestParser = new RegexRequestParser();

            var request = requestParser.Parse(Request);

            Assert.AreEqual("localhost:81", request.Headers["Host"]);
            Assert.AreEqual("Upgrade", request.Headers["Connection"]);
            Assert.AreEqual("no-cache", request.Headers["Pragma"]);
            Assert.AreEqual("no-cache", request.Headers["Cache-Control"]);
            Assert.AreEqual("websocket", request.Headers["Upgrade"]);
            Assert.AreEqual("null", request.Headers["Origin"]);
            Assert.AreEqual("13", request.Headers["Sec-WebSocket-Version"]);
            Assert.AreEqual("Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2107.3 Safari/537.36", request.Headers["User-Agent"]);
            Assert.AreEqual("gzip,deflate,sdch", request.Headers["Accept-Encoding"]);
            Assert.AreEqual("en-US,en;q=0.8", request.Headers["Accept-Language"]);
            Assert.AreEqual("ip6mLpbf94970+K6WnsdMA==", request.Headers["Sec-WebSocket-Key"]);
            Assert.AreEqual("permessage-deflate; client_max_window_bits", request.Headers["Sec-WebSocket-Extensions"]);
        }