HistoryDialogModel { public void selectRevisions(int first, int second) { doSelect(first, second); myIsChangesSelected = false; } HistoryDialogModel(IdeaGateway gw, LocalVcs vcs, VirtualFile f); List<Revision> getRevisions(); void selectRevisions(int first, int second); void selectChanges(int first, int second); void showChangesOnly(boolean value); boolean doesShowChangesOnly(); List<Change> getChanges(); void createPatch(String path, boolean isReverse); Reverter createReverter(); boolean isRevertEnabled(); boolean isCreatePatchEnabled(); boolean canPerformCreatePatch();  }
@Test public void testSelectingOnlyOneRevisionSetsRightToLastOne() { m.selectRevisions(0, 0); assertSelectedRevisins("3", "3"); m.selectRevisions(1, 1); assertSelectedRevisins("2", "3"); }
@Test public void testSelectingTwoRevisions() { m.selectRevisions(0, 1); assertSelectedRevisins("2", "3"); m.selectRevisions(1, 2); assertSelectedRevisins("1", "2"); }
@Test public void testClearingSelectionSetsRevisionsToLastOnes() { m.selectRevisions(-1, -1); assertSelectedRevisins("3", "3"); }