示例#1
0
        public void PathMismatchAction_PassedThrough(string matchPath, string basePath, string requestPath)
        {
            IDictionary<string, object> environment = CreateEmptyRequest(basePath, requestPath);
            IAppBuilder builder = new AppBuilder();
            builder.MapPath(matchPath, subBuilder => subBuilder.Run(FuncNotImplemented));
            builder.Run(Success);
            var app = builder.Build<AppFunc>();
            app(environment);

            Assert.Equal(200, environment["owin.ResponseStatusCode"]);
            Assert.Equal(basePath, environment["owin.RequestPathBase"]);
            Assert.Equal(requestPath, environment["owin.RequestPath"]);
        }
        public void PredicateAsyncFalseAction_PassThrough()
        {
            IDictionary<string, object> environment = CreateEmptyRequest();
            IAppBuilder builder = new AppBuilder();
            builder.MapPredicateAsync(FalsePredicateAsync, subBuilder => subBuilder.Run(FuncNotImplemented));
            builder.Run(Success);
            var app = builder.Build<AppFunc>();
            app(environment).Wait();

            Assert.Equal(200, environment["owin.ResponseStatusCode"]);
        }