public void Filter_BeforeActionReturningFalsePreventsActionProcessment()
		{
			var controller = new ControllerWithSingleBeforeActionFilter();

			var context = services.ControllerContextFactory.
				Create("", "home", "index",
				       services.ControllerDescriptorProvider.BuildDescriptor(controller));

			var filterMock = mockRepository.DynamicMock<IFilter>();

			using(mockRepository.Record())
			{
				Expect.Call(filterFactoryMock.Create(typeof(DummyFilter))).Return(filterMock);

				Expect.Call(filterMock.Perform(ExecuteWhen.BeforeAction, engineContext, controller, context)).Return(false);

				filterFactoryMock.Release(filterMock);
				LastCall.Repeat.Once();
			}

			using(mockRepository.Playback())
			{
				controller.Process(engineContext, context);
				controller.Dispose();

				Assert.IsNull(engStubViewEngineManager.TemplateRendered);
				Assert.IsFalse(controller.indexActionExecuted);
			}
		}
        public void Filter_BeforeActionReturningTrueAllowsProcessToContinue()
        {
            var controller = new ControllerWithSingleBeforeActionFilter();

            var context = services.ControllerContextFactory.
                          Create("", "home", "index",
                                 services.ControllerDescriptorProvider.BuildDescriptor(controller));

            var filterMock = mockRepository.DynamicMock <IFilter>();

            using (mockRepository.Record())
            {
                Expect.Call(filterFactoryMock.Create(typeof(DummyFilter))).Return(filterMock);

                Expect.Call(filterMock.Perform(ExecuteWhen.BeforeAction, engineContext, controller, context)).Return(true);

                filterFactoryMock.Release(filterMock);
                LastCall.Repeat.Once();
            }

            using (mockRepository.Playback())
            {
                controller.Process(engineContext, context);
                controller.Dispose();

                Assert.AreEqual("home\\index", engStubViewEngineManager.TemplateRendered);
                Assert.IsTrue(controller.indexActionExecuted);
            }
        }