Example #1
0
        public void TestEmptyBody()
        {
            var provider = new ResponseProvider();

            var router = Layout.Create().Index(provider.Wrap());

            using var runner = TestRunner.Run(router);

            var request = runner.GetRequest();

            request.Method    = "POST";
            request.KeepAlive = true;

            using var response = request.GetResponse();

            Assert.Equal("", response.ContentType);

            Assert.Equal(0, response.ContentLength);

            Assert.Equal("Keep-Alive", response.Headers["Connection"]);
        }