public void Add_GridColumnProcessor()
        {
            columns.Add(model => model.Name);

            Object expected = columns.Single();
            Object actual   = columns.Grid.Processors.Single();

            Assert.Same(expected, actual);
        }
Exemple #2
0
        public void Add_GridColumn()
        {
            Expression <Func <GridModel, String> > expression = (model) => model.Name;

            columns.Add(expression);

            GridColumn <GridModel, String> expected = new GridColumn <GridModel, String>(columns.Grid, expression);
            GridColumn <GridModel, String> actual   = columns.Single() as GridColumn <GridModel, String>;

            Assert.Equal(expected.Title.ToString(), actual.Title.ToString());
            Assert.Equal(expected.ProcessorType, actual.ProcessorType);
            Assert.Equal(expected.IsFilterable, actual.IsFilterable);
            Assert.Equal(expected.FilterName, actual.FilterName);
            Assert.Equal(expected.Expression, actual.Expression);
            Assert.Equal(expected.CssClasses, actual.CssClasses);
            Assert.Equal(expected.IsSortable, actual.IsSortable);
            Assert.Equal(expected.SortOrder, actual.SortOrder);
            Assert.Equal(expected.IsEncoded, actual.IsEncoded);
            Assert.Equal(expected.Format, actual.Format);
            Assert.Equal(expected.Name, actual.Name);
            Assert.Equal(expected.Grid, actual.Grid);
        }
Exemple #3
0
        public void Add_EmptyGridColumn()
        {
            columns.Add();

            GridColumn <GridModel, Object> expected = new GridColumn <GridModel, Object>(columns.Grid, model => null);
            GridColumn <GridModel, Object> actual   = columns.Single() as GridColumn <GridModel, Object>;

            Assert.Equal(expected.Title.ToString(), actual.Title.ToString());
            Assert.Equal(expected.ProcessorType, actual.ProcessorType);
            Assert.Equal(expected.IsFilterable, actual.IsFilterable);
            Assert.Null(actual.Expression.Compile().Invoke(null));
            Assert.Equal(expected.FilterName, actual.FilterName);
            Assert.Equal(expected.CssClasses, actual.CssClasses);
            Assert.Equal(expected.IsSortable, actual.IsSortable);
            Assert.Equal(expected.SortOrder, actual.SortOrder);
            Assert.Equal(expected.IsEncoded, actual.IsEncoded);
            Assert.Equal(expected.Format, actual.Format);
            Assert.Equal(expected.Name, actual.Name);
            Assert.Equal(expected.Grid, actual.Grid);
        }