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); }
public void ShouldNotFindNonRenderingControllerFoundByMatch1() { var router = new FunctionalRouter( new IRenderingControllerSearchDelegate[] { new FunctionalRenderingControllerSearchDelegate(x => typeof(CustomController)), }, null); router.FindNonRenderingControllerTypes(this.CreateContext("sdf").Request).Should().BeEmpty(); }
public void ShouldExecuteControllerNotFoundByMatch2() { var router = new FunctionalRouter( new IRenderingControllerSearchDelegate[] { new FunctionalRenderingControllerSearchDelegate(null), }, null); router.FindRenderingControllerType(this.CreateContext("sdf").Request).Should().BeNull(); }
public void ShouldExecuteControllerNotFoundNoDelegates() { var router = new FunctionalRouter(null, null); router.FindRenderingControllerType(this.CreateContext("sdf").Request).Should().BeNull(); }