public void adding_filters_for_selector()
        {
            var accessor1 = ReflectionHelper.GetAccessor<GridDefinitionTester.GridDefTarget>(x => x.Name);
            var accessor2 = ReflectionHelper.GetAccessor<GridDefinitionTester.GridDefTarget>(x => x.IsCool);

            var policies = new ColumnPolicies();
            policies.If(a => a.Name == "Name").FormatWith(new SlickGridFormatter("foo"));

            policies.FormatterFor(accessor1).ShouldEqual(new SlickGridFormatter("foo"));
            policies.FormatterFor(accessor2).ShouldBeNull();
        }
Beispiel #2
0
        public void adding_filters_for_selector()
        {
            var accessor1 = ReflectionHelper.GetAccessor <GridDefinitionTester.GridDefTarget>(x => x.Name);
            var accessor2 = ReflectionHelper.GetAccessor <GridDefinitionTester.GridDefTarget>(x => x.IsCool);

            var policies = new ColumnPolicies();

            policies.If(a => a.Name == "Name").FormatWith(new SlickGridFormatter("foo"));

            policies.FormatterFor(accessor1).ShouldEqual(new SlickGridFormatter("foo"));
            policies.FormatterFor(accessor2).ShouldBeNull();
        }
Beispiel #3
0
        public void first_filter_wins_with_formatters()
        {
            var accessor1 = ReflectionHelper.GetAccessor <GridDefinitionTester.GridDefTarget>(x => x.Name);
            var accessor2 = ReflectionHelper.GetAccessor <GridDefinitionTester.GridDefTarget>(x => x.IsCool);

            var policies = new ColumnPolicies();

            policies.If(a => a.Name == "Name").FormatWith(new SlickGridFormatter("foo"));
            policies.If(a => a.OwnerType == typeof(GridDefinitionTester.GridDefTarget)).FormatWith(new SlickGridFormatter("bar"));

            policies.FormatterFor(accessor1).ShouldEqual(new SlickGridFormatter("foo"));
            policies.FormatterFor(accessor2).ShouldEqual(new SlickGridFormatter("bar"));
        }
        public void first_filter_wins_with_formatters()
        {
            var accessor1 = ReflectionHelper.GetAccessor<GridDefinitionTester.GridDefTarget>(x => x.Name);
            var accessor2 = ReflectionHelper.GetAccessor<GridDefinitionTester.GridDefTarget>(x => x.IsCool);

            var policies = new ColumnPolicies();
            policies.If(a => a.Name == "Name").FormatWith(new SlickGridFormatter("foo"));
            policies.If(a => a.OwnerType == typeof(GridDefinitionTester.GridDefTarget)).FormatWith(new SlickGridFormatter("bar"));

            policies.FormatterFor(accessor1).ShouldEqual(new SlickGridFormatter("foo"));
            policies.FormatterFor(accessor2).ShouldEqual(new SlickGridFormatter("bar"));
        }