Debian Codegraph @

sejda-conversion/src/test/java/org/sejda/conversion/PageNumberWithPdfPageTransitionAdapterTest.java

raw
1 /*
2 * Created on 27/gen/2014
3 * Copyright 2014 by Andrea Vacondio ([email protected]).
4 *
5 * This file is part of the Sejda source code
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
16 *
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20 package org.sejda.conversion;
21
22 import static org.junit.Assert.assertEquals;
23 import static org.junit.Assert.assertNotNull;
24
25 import org.junit.Test;
26 import org.sejda.conversion.exception.ConversionException;
27 import org.sejda.model.pdf.transition.PdfPageTransitionStyle;
28
29 /**
30 * @author Andrea Vacondio
31 *
32 */
33 public class PageNumberWithPdfPageTransitionAdapterTest {
34
35 @Test(expected = ConversionException.class)
36 public void testNegative() {
37 new PageNumberWithPdfPageTransitionAdapter("box_inward:2:3");
38 }
39
40 @Test
41 public void testPositive() {
42 PageNumberWithPdfPageTransitionAdapter victim = new PageNumberWithPdfPageTransitionAdapter("box_inward:2:3:5");
43 assertEquals(5, victim.getPageNumber().intValue());
44 assertNotNull(victim.getPdfPageTransition());
45 assertEquals(PdfPageTransitionStyle.BOX_INWARD, victim.getPdfPageTransition().getStyle());
46 assertEquals(2, victim.getPdfPageTransition().getTransitionDuration());
47 assertEquals(3, victim.getPdfPageTransition().getDisplayDuration());
48 }
49 }