Example #1
0
        public void testGetIndex()
        {
            JDFRunList rlp = (JDFRunList)rl.addPartition(EnumPartIDKey.Run, "r1");

            rlp.setPages(new JDFIntegerRangeList("1 3 5 7"));
            Assert.AreEqual(0, rlp.getFirstIndex(), "first partition starts at 0");
            Assert.AreEqual(3, rlp.getLastIndex());
            rlp.setNPage(3);
            Assert.AreEqual(0, rlp.getFirstIndex());
            Assert.AreEqual(2, rlp.getLastIndex());
            JDFRunList rlp2 = (JDFRunList)rl.addPartition(EnumPartIDKey.Run, "r2");

            rlp2.setPages(new JDFIntegerRangeList("0 2 4 6"));
            Assert.AreEqual(3, rlp2.getFirstIndex());
            Assert.AreEqual(6, rlp2.getLastIndex());
            rlp2.setNPage(2);
            Assert.AreEqual(3, rlp2.getFirstIndex());
            Assert.AreEqual(4, rlp2.getLastIndex());
            JDFRunList rlp3 = (JDFRunList)rl.addPartition(EnumPartIDKey.Run, "r3");

            rlp2.setLogicalPage(11);
            rlp3.setPages(new JDFIntegerRangeList("0 2 4 6"));
            Assert.AreEqual(13, rlp3.getFirstIndex());
            Assert.AreEqual(16, rlp3.getLastIndex());
            rlp3.setNPage(2);
            rlp3.setLogicalPage(22);
            Assert.AreEqual(22, rlp3.getFirstIndex());
            Assert.AreEqual(23, rlp3.getLastIndex());
        }