public void Insert_InsertsGridColumn() { Expression <Func <GridModel, Int32> > expression = (model) => model.Sum; columns.Add(model => model.Name); columns.Insert(0, expression); GridColumn <GridModel, Int32> expected = new GridColumn <GridModel, Int32>(columns.Grid, expression); GridColumn <GridModel, Int32> actual = columns.First() as GridColumn <GridModel, Int32>; Assert.AreEqual(expected.ProcessorType, actual.ProcessorType); Assert.AreEqual(expected.IsFilterable, actual.IsFilterable); Assert.AreEqual(expected.FilterValue, actual.FilterValue); Assert.AreEqual(expected.FilterType, actual.FilterType); Assert.AreEqual(expected.FilterName, actual.FilterName); Assert.AreEqual(expected.Expression, actual.Expression); Assert.AreEqual(expected.CssClasses, actual.CssClasses); Assert.AreEqual(expected.IsSortable, actual.IsSortable); Assert.AreEqual(expected.SortOrder, actual.SortOrder); Assert.AreEqual(expected.IsEncoded, actual.IsEncoded); Assert.AreEqual(expected.Format, actual.Format); Assert.AreEqual(expected.Title, actual.Title); Assert.AreEqual(expected.Name, actual.Name); Assert.AreEqual(expected.Grid, actual.Grid); }
public void Insert_EmptyGridColumn() { columns.Add(model => model.Name); columns.Insert(0); GridColumn <GridModel, Object> expected = new GridColumn <GridModel, Object>(columns.Grid, model => null); GridColumn <GridModel, Object> actual = columns.First() 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); }
public void Insert_GridColumn() { columns.Add(model => 0); columns.Insert(0, model => 1); GridColumn <GridModel, Int32> expected = new GridColumn <GridModel, Int32>(columns.Grid, model => 1); GridColumn <GridModel, Int32> actual = columns.First() as GridColumn <GridModel, Int32>; Assert.Equal(expected.Filter.IsEnabled, actual.Filter.IsEnabled); Assert.Equal(expected.Title.ToString(), actual.Title.ToString()); Assert.Equal(expected.Sort.IsEnabled, actual.Sort.IsEnabled); Assert.Equal(expected.ProcessorType, actual.ProcessorType); Assert.Equal(1, actual.Expression.Compile().Invoke(null)); Assert.Equal(expected.Filter.Type, actual.Filter.Type); Assert.Equal(expected.Filter.Name, actual.Filter.Name); Assert.Equal(expected.CssClasses, actual.CssClasses); Assert.Equal(expected.Sort.Order, actual.Sort.Order); Assert.Equal(expected.IsEncoded, actual.IsEncoded); Assert.Equal(expected.Format, actual.Format); Assert.Equal(expected.Name, actual.Name); Assert.Equal(expected.Grid, actual.Grid); }