public void Setup() { action = new TestAction(); context = TestHelper.RequestContext(); locator = new FakeServiceLocator(); locator.Add<IActionMethodSelector>(new DefaultActionMethodSelector()); adaptor = new ControllerAdaptor(action, locator) { TempDataProvider = new NullTempDataProvider()}; }
public void Setup() { filters = new FilterCollection(); locator = new FakeServiceLocator(); locator.Add(filters); locator.Add<IActionMethodSelector>(new DefaultActionMethodSelector()); context = TestHelper.RequestContext(); context.RouteData.Values.Add("action","test"); action = new TestAction(); adaptor = new ControllerAdaptor(action, locator) { TempDataProvider = new NullTempDataProvider() }; }
public void When_action_returns_object_should_be_decorated_with_modelresult() { context.RouteData.Values.Add("controller", "Index"); context.RouteData.Values.Add("action", "Test"); var filter = new FilterInterceptsModel(); var filters = new FilterCollection(); filters.Apply<FilterInterceptsModel>().Always(); locator.Add(filter); locator.Add(filters); adaptor = new ControllerAdaptor(new TestActionReturnsModel(), locator) { TempDataProvider = new NullTempDataProvider() }; Execute(); filter.Model.ShouldNotBeNull(); }