HistoryDialogModel { public void selectChanges(int first, int second) { doSelect(first, second + 1); myIsChangesSelected = true; } 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 testSelectingSingleChange() { m.selectChanges(0, 0); assertSelectedRevisins("2", "3"); m.selectChanges(1, 1); assertSelectedRevisins("1", "2"); }
@Test public void testSelectingSeveralChanges() { vcs.beginChangeSet(); vcs.changeFileContent("f", null, -1); vcs.endChangeSet("4"); vcs.beginChangeSet(); vcs.changeFileContent("f", null, -1); vcs.endChangeSet("5"); initModelFor("f"); m.selectChanges(0, 1); assertSelectedRevisins("3", "5"); m.selectChanges(1, 2); assertSelectedRevisins("2", "4"); m.selectChanges(0, 3); assertSelectedRevisins("1", "5"); }