-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQuestionScraperTest.java
More file actions
58 lines (45 loc) · 1.46 KB
/
QuestionScraperTest.java
File metadata and controls
58 lines (45 loc) · 1.46 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
import static org.junit.Assert.*;
import java.util.ArrayList;
import org.junit.Before;
import org.junit.Test;
public class QuestionScraperTest {
private QuestionScraper qs;
@Before
public void setUp() {
qs = new QuestionScraper();
}
@Test
public void testGame1() {
Game g = qs.getGames().get(0);
System.out.println("Game Id: " + g.getId());
System.out.println();
Gameboard round1 = g.getGame1();
ArrayList<Question> round1Questions = round1.getQuestions();
//assertEquals(26, round1Questions.size());
for (Question q : round1Questions) {
System.out.println(q.getQuestion());
System.out.println(q.getAnswer());
System.out.println(q.getCategory().getName());
System.out.println(q.getCategory().getComment());
System.out.println("row: " + q.getRow() + ", col: " + q.getCol());
System.out.println();
}
for (Category c : round1.getCategories()) {
System.out.println(c.getName() + "'s questions are:");
for (Question q : c.getQuestions()) {
System.out.println(q.getQuestion());
}
System.out.println();
}
Gameboard round2 = g.getGame2();
ArrayList<Question> round2Questions = round2.getQuestions();
assertEquals(25, round2Questions.size());
for (Question q : round2Questions) {
System.out.println(q.getQuestion());
System.out.println(q.getAnswer());
System.out.println(q.getCategory().getName());
System.out.println("row: " + q.getRow() + ", col: " + q.getCol());
System.out.println();
}
}
}