public void GetEnumerator_SetsRowCssClasses() { IQueryable<GridModel> items = new[] { new GridModel(), new GridModel() }.AsQueryable(); Grid<GridModel> grid = new Grid<GridModel>(items); GridRows<GridModel> rows = new GridRows<GridModel>(grid); rows.CssClasses = (model) => "grid-row"; Assert.True(rows.All(row => row.CssClasses == "grid-row")); }
public void GetEnumerator_SetsRowCssClasses() { IQueryable <GridModel> models = new[] { new GridModel(), new GridModel() }.AsQueryable(); Grid <GridModel> grid = new Grid <GridModel>(models); GridRows <GridModel> rows = new GridRows <GridModel>(grid); rows.CssClasses = (model) => "grid-row"; Assert.IsTrue(rows.All(row => row.CssClasses == "grid-row")); }
public void GetEnumerator_SetsRowAttributes() { KeyValuePair <String, Object> attributes = new KeyValuePair <String, Object>("data-id", "1"); IQueryable <GridModel> items = new[] { new GridModel(), new GridModel() }.AsQueryable(); Grid <GridModel> grid = new Grid <GridModel>(items); GridRows <GridModel> rows = new GridRows <GridModel>(grid) { Attributes = (model) => new { data_id = "1" } }; Assert.True(rows.All(row => row.Attributes.Single().Key == attributes.Key && row.Attributes.Single().Value == attributes.Value)); }