コード例 #1
0
 @Test
 public void removesSelectionIfVetorAgrees() throws Exception {
   selectionModel.setSelectionInterval(1, 1);
   selectionModel.addVetor(new Allower());
   selectionModel.removeSelectionInterval(1, 1);
   assertEquals(-1, selectionModel.getMinSelectionIndex());
 }
コード例 #2
0
 @Test
 public void doesNotRequestVetoIfNothingChangesOnClearSelection() throws Exception {
   Vetor vetor = mock(Vetor.class);
   selectionModel.clearSelection();
   selectionModel.addVetor(vetor);
   selectionModel.clearSelection();
   verifyZeroInteractions(vetor);
 }
コード例 #3
0
 @Test
 public void removesVetorsForGood() throws Exception {
   Vetor vetor = mock(Vetor.class);
   selectionModel.addVetor(vetor);
   selectionModel.removeVetor(vetor);
   selectionModel.addSelectionInterval(1, 2);
   verifyZeroInteractions(vetor);
 }
コード例 #4
0
 @Test
 public void indexIndicatesNoSelectionAfterClearing() throws Exception {
   selectionModel.clearSelection();
   assertEquals(-1, selectionModel.getMinSelectionIndex());
 }
コード例 #5
0
 @Test
 public void addsSelectionIfVetorAgrees() throws Exception {
   selectionModel.addVetor(new Allower());
   selectionModel.addSelectionInterval(1, 2);
   assertEquals(2, selectionModel.getMinSelectionIndex());
 }
コード例 #6
0
 @Test
 public void doesNotChangeSelectionIfVetorDisagrees() throws Exception {
   selectionModel.addVetor(new Denier());
   selectionModel.addSelectionInterval(1, 2);
   assertEquals(-1, selectionModel.getMinSelectionIndex());
 }
コード例 #7
0
 @Test
 public void usesGivenSelectionMode() throws Exception {
   assertEquals(SINGLE_SELECTION, selectionModel.getSelectionMode());
 }