void () { { final RadContainer grid = SampleGrid.create(); assertEquals(GridChangeUtil.CellStatus.Required, GridChangeUtil.canDeleteCell(grid, 0, false)); assertEquals(GridChangeUtil.CellStatus.Required, GridChangeUtil.canDeleteCell(grid, 1, false)); assertEquals(GridChangeUtil.CellStatus.CanShift, GridChangeUtil.canDeleteCell(grid, 2, false)); assertEquals(GridChangeUtil.CellStatus.Redundant, GridChangeUtil.canDeleteCell(grid, 3, false)); assertEquals(GridChangeUtil.CellStatus.Redundant, GridChangeUtil.canDeleteCell(grid, 4, false)); } for (int i=0; i < SampleGrid.ORIGINAL_COLUMNS; i++){ final RadContainer grid = SampleGrid.create(); if (GridChangeUtil.canDeleteCell(grid, i, false) != GridChangeUtil.CellStatus.Required) { GridChangeUtil.deleteCell(grid, i, false); assertGridDimensions(grid, SampleGrid.ORIGINAL_ROWS, SampleGrid.ORIGINAL_COLUMNS - 1); } else { // exception should be thrown try { GridChangeUtil.deleteCell(grid, i, false); assertTrue(false); } catch (IllegalArgumentException ok) { } } } // no rows in SampleGrid should be deletable... { final RadContainer grid = SampleGrid.create(); for (int i=0; i < SampleGrid.ORIGINAL_ROWS; i++){ assertEquals(GridChangeUtil.CellStatus.Required, GridChangeUtil.canDeleteCell(grid, i, true)); } } }