Ejemplo n.º 1
0
        public void HttpServer_WhenSessionIsCorrectInASecuredContext_ThenChangesTheContext()
        {
            var server = new ServerHost(new Client("localhost", 901));
            string response;

            using (var httpServer = server.Do(
                new StartHttpServer(
                    new[]
                    {
                        "/test-template/"
                    })))
            {
                httpServer.Modules.Add(new xTagsHttpContextForTest("<r><template id='a' /></r>", "template"));
                var responseResult = HttpRequest.DoRequest("http://localhost:901/test-template/");
                Assert.IsFalse(responseResult.HasError);
                response = responseResult.Response;
            }

            Assert.AreEqual("<div id='a'></div>", response);
        }