public void adding_filters() { 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").EditWith(new SlickGridEditor("foo")); policies.EditorFor(accessor1).ShouldEqual(new SlickGridEditor("foo")); policies.EditorFor(accessor2).ShouldEqual(SlickGridEditor.Text); }
public void adding_filters() { 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").EditWith(new SlickGridEditor("foo")); policies.EditorFor(accessor1).ShouldEqual(new SlickGridEditor("foo")); policies.EditorFor(accessor2).ShouldEqual(SlickGridEditor.Text); }
public void first_filter_wins() { 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").EditWith(new SlickGridEditor("foo")); policies.If(a => a.OwnerType == typeof (GridDefinitionTester.GridDefTarget)).EditWith(new SlickGridEditor("bar")); policies.EditorFor(accessor1).ShouldEqual(new SlickGridEditor("foo")); policies.EditorFor(accessor2).ShouldEqual(new SlickGridEditor("bar")); }
public void first_filter_wins() { 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").EditWith(new SlickGridEditor("foo")); policies.If(a => a.OwnerType == typeof(GridDefinitionTester.GridDefTarget)).EditWith(new SlickGridEditor("bar")); policies.EditorFor(accessor1).ShouldEqual(new SlickGridEditor("foo")); policies.EditorFor(accessor2).ShouldEqual(new SlickGridEditor("bar")); }