AlignmentI smallAl = gen.generate(7, 2, 2, 5, 5);
- @BeforeMethod
+ @BeforeMethod(alwaysRun = true)
public void cleanUp()
{
ColumnSelection sel = new ColumnSelection();
assertTrue(l.verify(1, Arrays.asList("startres")));
l.reset();
}
+
+ @Test(groups = { "Functional" })
+ public void testGetWrappedScrollPosition()
+ {
+ AlignmentI al2 = gen.generate(157, 15, 1, 5, 5);
+ ViewportRanges vr = new ViewportRanges(al2);
+ vr.setStartEndRes(0, 39);
+ int width = vr.getViewportWidth(); // 40
+
+ /*
+ * scroll is 0 at column 0 (only)
+ */
+ assertEquals(vr.getWrappedScrollPosition(0), 0);
+
+ /*
+ * scroll is 1 at columns 1-40
+ */
+ int i = 1;
+ int j = width;
+ for (; i <= j; i++)
+ {
+ assertEquals(1, vr.getWrappedScrollPosition(i));
+ }
+
+ /*
+ * scroll is 2 at columns 41-80, etc
+ */
+ j += width;
+ for (; i <= j; i++)
+ {
+ assertEquals(2, vr.getWrappedScrollPosition(i), "For " + i);
+ }
+ }
}
// mock listener for property change events