public void SetNavigator_CustomInput_GridWithPagerAndNavigatorOverriding() { GridSettings4Test grid = new GridSettings4Test(); grid.ShowPager(true); grid.SetNavigator((new Navigator()) .SetAddButtonVisibility(false) .SetEditButtonVisibility(true) .SetDeleteButtonVisibility(false) .SetRefreshButtonVisibility(true) .SetSearchButtonVisibility(true)); string expected = string.Format( @"<table id='{0}'></table> <div id='{1}'></div> <script type=""text/javascript""> $(function(){{ $(""#Grid"").jqGrid({{ pager: '#{1}' }}); $('#{0}').navGrid('#{1}', {{ add: false, edit: true, del: false, refresh: true, search: true }}); }}); </script>", grid.GridId, grid.PagerId).RemoveSpaces(); string actual = grid.ToString().RemoveSpaces(); Assert.AreEqual(expected, actual); }
public void SetNavigator_WithDefaultShowPager_DefaultGrid() { GridSettings4Test grid = new GridSettings4Test(); grid.SetNavigator(new Navigator()); string expected = string.Format( @"<table id='{0}'></table> <script type=""text/javascript""> $(function(){{ $(""#Grid"").jqGrid({{}}); }}); </script>", grid.GridId).RemoveSpaces(); string actual = grid.ToString().RemoveSpaces(); Assert.AreEqual(expected, actual); }