-
-
Notifications
You must be signed in to change notification settings - Fork 156
Expand file tree
/
Copy pathTableTest.java
More file actions
39 lines (28 loc) · 752 Bytes
/
TableTest.java
File metadata and controls
39 lines (28 loc) · 752 Bytes
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
package processing.data;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
public class TableTest {
class Person {
public String name;
public int age;
public Person() {
name = "";
age = -1;
}
}
Person[] people;
@Test
public void parseInto() {
Table table = new Table();
table.addColumn("name");
table.addColumn("age");
TableRow row = table.addRow();
row.setString("name", "Person1");
row.setInt("age", 30);
table.parseInto(this, "people");
Assert.assertEquals(people[0].name, "Person1");
Assert.assertEquals(people[0].age, 30);
}
}