public void PartialViewResultTest()
        {
            var action = new TestController()
                .ChildAction(c => c.ChildPartialViewAction());

            action.GetAuthorizationResult().Should().BeNull();
            var result = action.GetActionResult();

            result.Should().BeOfType<PartialViewResult>();
        }
        public void PostActionIsNotAllowedWithGetTest()
        {
            // arrange 
            var controller = new TestController();

            // act 
            var controllerAction = GetUpdateAction(controller);

            // assert
            Assert.Catch<HttpException>(() => controllerAction.GetActionResult());
        }
 protected abstract ControllerAction GetUpdateAction(TestController testController);
 protected abstract ControllerAction GetIndexAction(TestController testController);
 protected abstract ControllerAction GetActionUsingUrl(TestController testController);
 protected abstract ControllerAction GetChildAction(TestController testController);
 protected override ControllerAction GetActionUsingUrl(TestController testController)
 {
     return testController.Action(c => c.ActionUsingUrl());
 }
 protected override ControllerAction GetChildAction(TestController testController)
 {
     return testController.Action(c => c.ChildPartialViewAction());
 }
 protected override ControllerAction GetUpdateAction(TestController testController)
 {
     return testController.Action(c => c.Update());
 }
Exemplo n.º 10
0
 protected override ControllerAction GetIndexAction(TestController testController)
 {
     return testController.Action(c => c.Index());
 }
 protected override ControllerAction GetIndexAction(TestController testController)
 {
     return testController.Action("index");
 }
 protected override ControllerAction GetUpdateAction(TestController testController)
 {
     return testController.Action("update");
 }