public void ProcessStubContext()
        {
            var ctx = new Mock <HttpContextBase>();
            var app = new ExpressApplication();

            Assert.IsFalse(app.Process(ctx.Object));
        }
        public void GetText()
        {
            var app = new ExpressApplication();
            app.Get("test", req => req.Text("test"));

            var request = new Mock<HttpRequestBaseImpl> {CallBase = true};
            request.Setup(x => x.Url).Returns(new Uri("http://localhost/test"));

            var response = new Mock<HttpResponseBase>();

            var ctx = new Mock<HttpContextBase>();
            ctx.Setup(x => x.Request).Returns(request.Object);
            ctx.Setup(x => x.Response).Returns(response.Object);

            Assert.IsTrue(app.Process(ctx.Object));
        }
        public void GetText()
        {
            var app = new ExpressApplication();

            app.Get("test", req => req.Text("test"));

            var request = new Mock <HttpRequestBaseImpl> {
                CallBase = true
            };

            request.Setup(x => x.Url).Returns(new Uri("http://localhost/test"));

            var response = new Mock <HttpResponseBase>();

            var ctx = new Mock <HttpContextBase>();

            ctx.Setup(x => x.Request).Returns(request.Object);
            ctx.Setup(x => x.Response).Returns(response.Object);

            Assert.IsTrue(app.Process(ctx.Object));
        }
Esempio n. 4
0
        public static ExpressApplication Nest(this ExpressApplication app, string prefix, ExpressApplication nested)
        {
            var url = prefix.EndsWith("/") ? prefix + "{*}" : prefix + "/{*}";

            return(app.All(url, req => nested.Process(req.HttpContext)));
        }
Esempio n. 5
0
 public static ExpressApplication Nest(this ExpressApplication app, string prefix, ExpressApplication nested)
 {
     var url = prefix.EndsWith("/") ? prefix + "{*}" : prefix + "/{*}";
     return app.All(url, req => nested.Process(req.HttpContext));
 }
 public void ProcessStubContext()
 {
     var ctx = new Mock<HttpContextBase>();
     var app = new ExpressApplication();
     Assert.IsFalse(app.Process(ctx.Object));
 }