public void building_a_ConfigurationGraph_with_no_modification_to_ViewAttacher_gets_you_the_default_view_attachment_filters()
        {
            var attacher = new ViewAttachmentPolicy();

            attacher.ActiveFilters.Select(x => x.GetType())
                .ShouldHaveTheSameElementsAs(typeof(ActionWithSameNameAndFolderAsViewReturnsViewModelType), typeof(ActionInSameFolderAsViewReturnsViewModelType), typeof(ActionReturnsViewModelType));
        }
        public void building_a_ConfigurationGraph_with_no_modification_to_ViewAttacher_gets_you_the_default_view_attachment_filters()
        {
            var attacher = new ViewAttachmentPolicy();

            attacher.ActiveFilters.Select(x => x.GetType())
            .ShouldHaveTheSameElementsAs(typeof(ActionWithSameNameAndFolderAsViewReturnsViewModelType), typeof(ActionInSameFolderAsViewReturnsViewModelType), typeof(ActionReturnsViewModelType));
        }
        public void use_explicit_ViewAttachmentFilters_if_that_is_what_is_used()
        {
            var attacher = new ViewAttachmentPolicy();
            attacher.AddFilter(new ActionReturnsViewModelType());

            attacher.ActiveFilters.Select(x => x.GetType())
                            .ShouldHaveTheSameElementsAs(typeof(ActionReturnsViewModelType));
        }
        public void use_explicit_ViewAttachmentFilters_if_that_is_what_is_used()
        {
            var attacher = new ViewAttachmentPolicy();

            attacher.AddFilter(new ActionReturnsViewModelType());

            attacher.ActiveFilters.Select(x => x.GetType())
            .ShouldHaveTheSameElementsAs(typeof(ActionReturnsViewModelType));
        }
Пример #5
0
        public void SetUp()
        {
            theViews = new List <IViewToken>();
            for (int i = 0; i < 15; i++)
            {
                theViews.Add(MockRepository.GenerateMock <ITemplateFile>());
            }

            theAction = ActionCall.For <GoController>(x => x.Go());
            theChain  = new BehaviorChain();
            theChain.AddToEnd(theAction);

            thePolicy = new ViewAttachmentPolicy();
        }
Пример #6
0
 public ViewAttachmentWorker(ViewBag views, ViewAttachmentPolicy policy)
 {
     _views = views;
     _policy = policy;
 }