forked from tabulapdf/tabula-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTableTest.java
45 lines (29 loc) · 1 KB
/
TableTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package technology.tabula;
import static org.junit.Assert.*;
import org.junit.Test;
public class TableTest {
@Test public void testEmpty() {
Table empty = Table.empty();
assertEquals(TextChunk.EMPTY, empty.getCell(0, 0));
assertEquals(TextChunk.EMPTY, empty.getCell(1, 1));
assertEquals(0, empty.getRowCount());
assertEquals(0, empty.getColCount());
assertEquals("", empty.getExtractionMethod());
assertEquals(0, empty.getTop(), 0);
assertEquals(0, empty.getRight(), 0);
assertEquals(0, empty.getBottom(), 0);
assertEquals(0, empty.getLeft(), 0);
assertEquals(0, empty.getArea(), 0);
}
@Test public void testRowColCounts() {
Table table = Table.empty();
assertEquals(0, table.getRowCount());
assertEquals(0, table.getColCount());
table.add(TextChunk.EMPTY, 0, 0);
assertEquals(1, table.getRowCount());
assertEquals(1, table.getColCount());
table.add(TextChunk.EMPTY, 9, 9);
assertEquals(10, table.getRowCount());
assertEquals(10, table.getColCount());
}
}