public void ActionIsExecuted()
		{
			ControllerExecutor executor = new ControllerExecutor(controller, testContext);

			executor.Execute(executor.SelectAction());

			Assert.IsTrue(controller.wasRun, "ControllerExecutor failed to execute the action");
		}
		public void ActionIsSelectedBasedOnUrlActionPiece()
		{
			ControllerExecutor executor = new ControllerExecutor(controller, testContext);

			ActionExecutor actionExec = executor.SelectAction();

			Assert.IsNotNull(actionExec);
			Assert.AreEqual(ActionType.Method, actionExec.ActionType);
			Assert.AreEqual("Index", actionExec.Name);
		}
Esempio n. 3
0
        public void Initialize()
        {
            _controllerFactory         = new Mock <IControllerFactory>();
            _controllerResponseBuilder = new Mock <IControllerResponseBuilder>();
            _executor = new ControllerExecutor(_controllerFactory.Object, _controllerResponseBuilder.Object);

            _syncController      = new Mock <Controller>();
            _asyncController     = new Mock <AsyncController>();
            _syncModelController = new Mock <Controller <TestModel> >();
            _controllerResponse  = new Mock <ControllerResponse>();
        }
		public void ActionIsSelectedAndRun()
		{
			ControllerExecutor executor = new ControllerExecutor(controller, testContext);

			ActionExecutor actionExec = executor.SelectAction();

			Assert.IsNotNull(actionExec);
			Assert.AreEqual(ActionType.Method, actionExec.ActionType);
			Assert.AreEqual("Index", actionExec.Name);

			executor.Execute(actionExec);

			Assert.IsTrue(controller.wasRun);
		}