assertSelectionAnchorEquals(4, lastRow);
}
@Test
public void movingSelectionWithUpArrow() throws Exception {
natTable.doCommand(new SelectCellCommand(natTable, 5, 4, NO_SHIFT,
NO_CTRL));
// Note: the co-ordinates from this point on are in selection later
// co-ordinates
SWTUtils.pressKey(SWT.ARROW_UP, natTable);
assertPositionEquals(4, 2, selectionLayer.getSelectedCellPositions()[0]);
assertSelectionAnchorEquals(4, 2);
SWTUtils.pressKey(SWT.ARROW_UP, SWT.SHIFT, natTable);
SWTUtils.pressKey(SWT.ARROW_UP, SWT.SHIFT, natTable);
assertSelectCellsCount(3);
assertCellSelected(4, 0);
assertCellSelected(4, 1);
assertCellSelected(4, 2);
assertSelectionAnchorEquals(4, 2);
natTable.doCommand(new SelectCellCommand(natTable, 5, 4, NO_SHIFT,
NO_CTRL));
assertSelectCellsCount(1);
SWTUtils.pressKey(SWT.ARROW_UP, SWT.MOD1, natTable);
assertSelectCellsCount(1);