Ejemplo n.º 1
0
        public async Task RunAsync_WithAnonymousMiddleware_ShouldBeExecuted()
        {
            var tests = new TestCases();

            var container = new WindsorContainer();

            container.AddChainOfResponsability();

            IPipelineBuilder pipeline = container.GetChainOfResponsability();

            await tests.RunAsync_WithAnonymousMiddleware_ShouldBeExecuted(pipeline);
        }
Ejemplo n.º 2
0
        public async Task RunAsync_WithCancellationToken_ShouldBeThrowException()
        {
            var tests = new TestCases();

            var container = new WindsorContainer();

            container.AddChainOfResponsability(c =>
            {
                c.AddAsyncMiddleware <AsyncMiddlewareD, Data>();

                c.AddAsyncMiddleware <AsyncMiddlewareE, Data>();
            });

            IPipelineBuilder pipeline = container.GetChainOfResponsability();

            await tests.RunAsync_WithCancellationToken_ShouldBeThrowException(pipeline);
        }
Ejemplo n.º 3
0
        public async Task RunAsync_WithStrongTypedMiddleware_ShouldBeExecuted()
        {
            var tests = new TestCases();

            var container = new WindsorContainer();

            container.AddChainOfResponsability(c =>
            {
                c.AddAsyncMiddleware <AsyncMiddlewareA, Data>();

                c.AddAsyncMiddleware <AsyncMiddlewareB, Data>();

                c.AddAsyncMiddleware <AsyncMiddlewareC, Data>();
            });

            IPipelineBuilder pipeline = container.GetChainOfResponsability();

            await tests.RunAsync_WithStrongTypedMiddleware_ShouldBeExecuted(pipeline);
        }