forked from tabulapdf/tabula-java
-
Notifications
You must be signed in to change notification settings - Fork 2
/
TestCellPosition.java
45 lines (31 loc) · 983 Bytes
/
TestCellPosition.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;
import technology.tabula.Table.CellPosition;
public class TestCellPosition {
@Test
public void testHashCode() {
Table table = new Table();
CellPosition cellPosition = table.new CellPosition(5, 5);
assertEquals(500005, cellPosition.hashCode());
}
@Test
public void testEqualsObject() {
Table table = new Table();
CellPosition cellPosition1 = table.new CellPosition(5, 5);
assertTrue(cellPosition1.equals(cellPosition1));
}
@Test
public void testNotEqualsObject() {
Table table = new Table();
CellPosition cellPosition1 = table.new CellPosition(5, 5);
CellPosition cellPosition2 = table.new CellPosition(5, 6);
assertFalse(cellPosition1.equals(cellPosition2));
}
@Test
public void testNotInstanceOfObject() {
Table table = new Table();
CellPosition cellPosition = table.new CellPosition(5, 5);
assertFalse(cellPosition.equals("test"));
}
}