JAL-2491 Tests
authorkiramt <k.mourao@dundee.ac.uk>
Mon, 15 May 2017 08:42:17 +0000 (09:42 +0100)
committerkiramt <k.mourao@dundee.ac.uk>
Mon, 15 May 2017 08:42:17 +0000 (09:42 +0100)
test/jalview/viewmodel/ViewportRangesTest.java

index 4e15b80..3cd2096 100644 (file)
@@ -94,11 +94,11 @@ public class ViewportRangesTest {
     vr.setStartSeq(-1);
     assertEquals(vr.getStartSeq(), 0);
 
-    vr.setStartSeq(al.getHeight());
-    assertEquals(vr.getStartSeq(), al.getHeight() - 1);
+    vr.setStartSeq(al.getHeight() - vr.getViewportHeight() + 1);
+    assertEquals(vr.getStartSeq(), al.getHeight() - vr.getViewportHeight());
 
-    vr.setStartSeq(al.getHeight() - 1);
-    assertEquals(vr.getStartSeq(), al.getHeight() - 1);
+    vr.setStartSeq(al.getHeight() - vr.getViewportHeight());
+    assertEquals(vr.getStartSeq(), al.getHeight() - vr.getViewportHeight());
   }
 
   @Test(groups = { "Functional" })
@@ -298,6 +298,10 @@ public class ViewportRangesTest {
     MockPropChangeListener l = new MockPropChangeListener(vr);
     List<String> emptylist = new ArrayList<String>();
 
+    vr.setViewportWidth(5);
+    vr.setViewportHeight(5);
+    l.reset();
+
     // one event fired when startRes is called with new value
     vr.setStartRes(4);
     assertTrue(l.verify(1, Arrays.asList("startres")));