Ejemplo n.º 1
0
        public async Task ScriptFileCanBeExecutedByName()
        {
            var factory = new RoslynAppLoaderFactory();
            Func<string, IList<string>, Action<IAppBuilder>> loader = factory.Create((_, __) => null);
            Action<IAppBuilder> startup = loader.Invoke("Simple.csx", null);
            var builder = new AppBuilder();
            startup.Invoke(builder);
            var app = builder.Build<OwinMiddleware>();

            IOwinContext context = new OwinContext();
            await app.Invoke(context);
            context.Response.StatusCode.ShouldBe(24601);
        }
Ejemplo n.º 2
0
        public async Task ScriptFileCanBeExecutedByName()
        {
            var factory = new RoslynAppLoaderFactory();
            Func<string, Action<IAppBuilder>> loader = factory.Create(_ => null);
            Action<IAppBuilder> startup = loader.Invoke("Simple.csx");
            var builder = new AppBuilder();
            startup.Invoke(builder);
            var app = (AppFunc)builder.Build(typeof(AppFunc));

            OwinRequest req = OwinRequest.Create();
            await app.Invoke(req.Dictionary);
            var res = new OwinResponse(req);
            res.StatusCode.ShouldBe(24601);
        }
        public async Task ScriptFileCanBeExecutedByName()
        {
            var factory = new RoslynAppLoaderFactory();
            Func <string, IList <string>, Action <IAppBuilder> > loader = factory.Create((_, __) => null);
            Action <IAppBuilder> startup = loader.Invoke("Simple.csx", null);
            var builder = new AppBuilder();

            startup.Invoke(builder);
            var app = builder.Build <OwinMiddleware>();

            IOwinContext context = new OwinContext();
            await app.Invoke(context);

            context.Response.StatusCode.ShouldBe(24601);
        }
Ejemplo n.º 4
0
        public async Task ScriptFileCanBeExecutedByName()
        {
            var factory = new RoslynAppLoaderFactory();
            Func <string, Action <IAppBuilder> > loader = factory.Create(_ => null);
            Action <IAppBuilder> startup = loader.Invoke("Simple.csx");
            var builder = new AppBuilder();

            startup.Invoke(builder);
            var app = (AppFunc)builder.Build(typeof(AppFunc));

            OwinRequest req = OwinRequest.Create();
            await app.Invoke(req.Dictionary);

            var res = new OwinResponse(req);

            res.StatusCode.ShouldBe(24601);
        }