public void Setup()
 {
     _observer           = new RecordingConfigurationObserver();
     _action             = ActionCall.For <ViewsForActionFilterTesterController>(x => x.AAction());
     _fromFindsOne       = new FakeViewToken();
     _fromSecondFindsOne = new FakeViewToken();
     _views = new ViewBag(new IViewToken[] { _fromFindsOne, _fromSecondFindsOne });
     _filterThatFindsNone             = createFilterThatReturns(new IViewToken[0]);
     _firstFilterThatFindsExactlyOne  = createFilterThatReturns(_fromFindsOne);
     _secondFilterThatFindsExactlyOne = createFilterThatReturns(_fromSecondFindsOne);
     _filterThatFindsMultiple         = createFilterThatReturns(_fromFindsOne, _fromSecondFindsOne);
     _viewAttacherConvention          = new ViewAttacherConvention();
 }
 public void Setup()
 {
     _observer = new RecordingConfigurationObserver();
     _action = ActionCall.For<ViewsForActionFilterTesterController>(x => x.AAction());
     _fromFindsOne = new FakeViewToken();
     _fromSecondFindsOne = new FakeViewToken();
     _views = new ViewBag(new IViewToken[] { _fromFindsOne, _fromSecondFindsOne });
     _filterThatFindsNone = createFilterThatReturns(new IViewToken[0]);
     _firstFilterThatFindsExactlyOne = createFilterThatReturns(_fromFindsOne);
     _secondFilterThatFindsExactlyOne = createFilterThatReturns(_fromSecondFindsOne);
     _filterThatFindsMultiple = createFilterThatReturns(_fromFindsOne, _fromSecondFindsOne);
     _viewAttacherConvention = new ViewAttacherConvention();
 }
Ejemplo n.º 3
0
 public void behavior_node_get_enum_should_yield_next()
 {
     BehaviorNode node = new FakeViewToken();
     var secondNode = new BehaviorChain();
     var thirdNode = new BehaviorChain();
     node.AddAfter(secondNode);
     secondNode.AddAfter(thirdNode);
     var enumerator = node.GetEnumerator();
     enumerator.MoveNext();
     enumerator.Current.ShouldEqual(secondNode);
     enumerator.MoveNext();
     enumerator.Current.ShouldEqual(thirdNode);
     enumerator.MoveNext().ShouldBeFalse();
 }
Ejemplo n.º 4
0
        public void SetUp()
        {
            token = new FakeViewToken
            {
                ViewName  = "A",
                Namespace = GetType().Namespace,
                ViewModel = typeof(ViewModel1)
            };
            var views = new List <IViewToken>
            {
                token
            };

            bag = new ViewBag(views);

            filter = new ActionInSameFolderAsViewReturnsViewModelType();
        }
Ejemplo n.º 5
0
        public void SetUp()
        {
            token = new FakeViewToken
            {
                Name          = "AAction",
                Folder        = GetType().Namespace,
                ViewType      = typeof(AAction),
                ViewModelType = typeof(ViewModel1)
            };
            var views = new List <IViewToken>
            {
                token
            };

            bag = new ViewBag(views);

            filter = new ActionWithSameNameAndFolderAsViewReturnsViewModelType();
        }
        public void SetUp()
        {
            token = new FakeViewToken
            {
                ViewName = "AAction",
                Namespace = GetType().Namespace,
                ViewModel = typeof (ViewModel1)
            };
            var views = new List<IViewToken>
            {
                token
            };

            bag = new ViewBag(views);

            filter = new ActionWithSameNameAndFolderAsViewReturnsViewModelType();
        }
Ejemplo n.º 7
0
        public void SetUp()
        {
            token = new FakeViewToken
            {
                Name = "A",
                Folder = GetType().Namespace,
                ViewType = typeof(FakeViewToken),
                ViewModelType = typeof (ViewModel1)
            };
            var views = new List<IViewToken>
            {
                token
            };

            bag = new ViewBag(views);

            filter = new ActionInSameFolderAsViewReturnsViewModelType();
        }
Ejemplo n.º 8
0
        public void SetUp()
        {
            token = new FakeViewToken
            {
                Name = "A",
                Namespace = GetType().Namespace,
                ViewModelType = typeof (ViewModel1)
            };
            var views = new List<IViewToken>
            {
                token
            };

            bag = new ViewBag(views);

            strategy = new TypeAndNamespace();
        }
        public void SetUp()
        {
            token = new FakeViewToken
            {
                ViewType = typeof(AAction),
                ViewModelType = typeof (ViewModel1)
            };
            var views = new List<IViewToken>
            {
                token
            };

            bag = new ViewBag(views);

            strategy = new TypeAndNamespaceAndName();
        }