From 557859a3ea9a1e86899ef2033de90eadb6d87118 Mon Sep 17 00:00:00 2001 From: kiramt Date: Mon, 15 May 2017 09:42:17 +0100 Subject: [PATCH] JAL-2491 Tests --- test/jalview/viewmodel/ViewportRangesTest.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/jalview/viewmodel/ViewportRangesTest.java b/test/jalview/viewmodel/ViewportRangesTest.java index 4e15b80..3cd2096 100644 --- a/test/jalview/viewmodel/ViewportRangesTest.java +++ b/test/jalview/viewmodel/ViewportRangesTest.java @@ -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 emptylist = new ArrayList(); + 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"))); -- 1.7.10.2