public void datasource_count_should_be_less_than_page_size_for_incomplete_pages() { var grid = new PowerGridControl(); var dataSource = from DataRow row in _rawData.Rows.OfType <DataRow>().AsQueryable() select row; grid.Configure(dataSource, () => 55, 10); grid.OnGotoLast(); Assert.IsTrue(((IEnumerable <DataRow>)grid.DataSource).Count() < 10); }
public void datasource_count_should_be_less_than_page_size_for_incomplete_pages() { var grid = new PowerGridControl(); var dataSource = from DataRow row in _rawData.Rows.OfType<DataRow>().AsQueryable() select row; grid.Configure(dataSource, () => 55, 10); grid.OnGotoLast(); Assert.IsTrue(((IEnumerable<DataRow>)grid.DataSource).Count() < 10); }
public void goto_last_page() { var grid = new PowerGridControl(); var dataSource = from DataRow row in _rawData.Rows.OfType <DataRow>().AsQueryable() select row; grid.Configure(dataSource, () => 50, 10); grid.OnGotoLast(); Assert.AreEqual(4, grid.CurrentPage); Assert.AreEqual("foo40", ((IEnumerable <DataRow>)grid.DataSource).ToList()[0][1]); }
public void goto_last_page() { var grid = new PowerGridControl(); var dataSource = from DataRow row in _rawData.Rows.OfType<DataRow>().AsQueryable() select row; grid.Configure(dataSource, () => 50, 10); grid.OnGotoLast(); Assert.AreEqual(4, grid.CurrentPage); Assert.AreEqual("foo40", ((IEnumerable<DataRow>)grid.DataSource).ToList()[0][1]); }
public void goto_last_incomplete_page() { for (var i = 0; i < 5; i++) _rawData.Rows.Add(new object[] { i, "foo5" + i }); var grid = new PowerGridControl(); var dataSource = from DataRow row in _rawData.Rows.OfType<DataRow>().AsQueryable() select row; grid.Configure(dataSource, () => 55, 10); grid.OnGotoLast(); Assert.AreEqual(5, grid.CurrentPage); Assert.AreEqual(5, ((IEnumerable<DataRow>)grid.DataSource).Count()); Assert.AreEqual("foo50", ((IEnumerable<DataRow>)grid.DataSource).ToList()[0][1]); }
public void goto_last_incomplete_page() { for (var i = 0; i < 5; i++) { _rawData.Rows.Add(new object[] { i, "foo5" + i }); } var grid = new PowerGridControl(); var dataSource = from DataRow row in _rawData.Rows.OfType <DataRow>().AsQueryable() select row; grid.Configure(dataSource, () => 55, 10); grid.OnGotoLast(); Assert.AreEqual(5, grid.CurrentPage); Assert.AreEqual(5, ((IEnumerable <DataRow>)grid.DataSource).Count()); Assert.AreEqual("foo50", ((IEnumerable <DataRow>)grid.DataSource).ToList()[0][1]); }