Example #1
0
        public void ShouldFindNonRenderingControllerFoundByMatch()
        {
            var router = new FunctionalRouter(
                new IRenderingControllerSearchDelegate[] { new FunctionalRenderingControllerSearchDelegate(x => typeof(CustomController)), },
                new INonRenderingControllerSearchDelegate[] { new FunctionalNonRenderingControllerSearchDelegate(x => typeof(CustomNonRenderingController)), });

            router.FindNonRenderingControllerTypes(this.CreateContext("sdf").Request).Should().HaveCount(1);
        }
Example #2
0
        public void ShouldNotFindNonRenderingControllerFoundByMatch1()
        {
            var router = new FunctionalRouter(
                new IRenderingControllerSearchDelegate[] { new FunctionalRenderingControllerSearchDelegate(x => typeof(CustomController)), },
                null);

            router.FindNonRenderingControllerTypes(this.CreateContext("sdf").Request).Should().BeEmpty();
        }
Example #3
0
        public void ShouldExecuteControllerNotFoundByMatch2()
        {
            var router = new FunctionalRouter(
                new IRenderingControllerSearchDelegate[] { new FunctionalRenderingControllerSearchDelegate(null), },
                null);

            router.FindRenderingControllerType(this.CreateContext("sdf").Request).Should().BeNull();
        }
Example #4
0
        public void ShouldExecuteControllerNotFoundNoDelegates()
        {
            var router = new FunctionalRouter(null, null);

            router.FindRenderingControllerType(this.CreateContext("sdf").Request).Should().BeNull();
        }