DirectoryChangeModel { public boolean canShowFileDifference() { return isFile(); } DirectoryChangeModel(Difference d, IdeaGateway gw, boolean editableRightContent); Difference getDifference(); boolean isFile(); String getEntryName(int i); Entry getEntry(int i); FileDifferenceModel getFileDifferenceModel(); boolean canShowFileDifference(); ContentRevision getContentRevision(int i);  }
@Test public void testCanShowFileDifference() { Entry left = new FileEntry(-1, "left", c(""), -1, false); Entry right = new FileEntry(-1, "right", c(""), -1, false); Difference d1 = new Difference(true, left, right); Difference d2 = new Difference(true, null, right); Difference d3 = new Difference(true, left, null); assertTrue(createModelOn(d1).canShowFileDifference()); assertTrue(createModelOn(d2).canShowFileDifference()); assertTrue(createModelOn(d3).canShowFileDifference()); }
@Test public void testCanNotShowFileDifferenceForDirectories() { Entry left = new DirectoryEntry(-1, "left"); Entry right = new DirectoryEntry(-1, "right"); Difference d = new Difference(false, left, right); assertFalse(createModelOn(d).canShowFileDifference()); }