public void TestMainMethods() { _server.WithPaging(5); Assert.IsTrue(_server.Grid.EnablePaging); Assert.AreEqual(_server.Grid.Pager.PageSize, 5); _server.WithMultipleFilters(); Assert.IsTrue(_server.Grid.RenderOptions.AllowMultipleFilters); _server.Searchable(); Assert.IsTrue(_server.Grid.SearchingEnabled); Assert.IsTrue(_server.Grid.SearchingOnlyTextColumns); _server.Named("test"); Assert.AreEqual(_server.Grid.RenderOptions.GridName, "test"); _server.Selectable(true); Assert.IsTrue(_server.Grid.RenderOptions.Selectable); _server.ChangePageSize(true); Assert.IsTrue(_server.Grid.Pager.ChangePageSize); _server.ClearFiltersButton(true); Assert.IsTrue(_server.Grid.ClearFiltersButtonEnabled); _server.ExtSortable(true); Assert.IsTrue(_server.Grid.ExtSortingEnabled); _server.Groupable(false); Assert.IsFalse(_server.Grid.ExtSortingEnabled); Assert.IsFalse(_server.Grid.GroupingEnabled); }
public void TestMainMethods() { _server.WithPaging(5); string gridState = _server.Grid.GetState(); var query = StringExtensions.GetQuery(gridState); foreach (var element in query) { Assert.IsTrue(_server.Grid.Query.ContainsKey(element.Key)); Assert.AreEqual(_server.Grid.Query[element.Key], element.Value); } Dictionary <string, StringValues> store = new Dictionary <string, StringValues>(); store.Add("grid-search", "TEST"); store.Add("grid-page", "2"); _server = new GridServer <TestModel>(Enumerable.Empty <TestModel>(), new QueryCollection(store), false, "_Grid", _columns, 10); _server.Searchable(); gridState = _server.Grid.GetState(); query = StringExtensions.GetQuery(gridState); foreach (var element in query) { Assert.IsTrue(_server.Grid.Query.ContainsKey(element.Key)); Assert.AreEqual(_server.Grid.Query[element.Key], element.Value); } }
public void TestMainMethods() { _server.WithPaging(5); Assert.IsTrue(_server.Grid.EnablePaging); Assert.AreEqual(_server.Grid.Pager.PageSize, 5); _server.WithMultipleFilters(); Assert.IsTrue(_server.Grid.RenderOptions.AllowMultipleFilters); _server.Searchable(); Assert.IsTrue(_server.Grid.SearchingEnabled); Assert.IsTrue(_server.Grid.SearchingOnlyTextColumns); _server.Named("test"); Assert.AreEqual(_server.Grid.RenderOptions.GridName, "test"); _server.Selectable(true); Assert.IsTrue(_server.Grid.RenderOptions.Selectable); }