forked from guninkakar03/BoggleGame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoggleTests.java
More file actions
82 lines (77 loc) · 2.44 KB
/
BoggleTests.java
File metadata and controls
82 lines (77 loc) · 2.44 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//import java.io.ByteArrayInputStream;
//import java.io.InputStream;
//import java.io.OutputStream;
//import java.io.PrintStream;
//import java.util.*;
//import java.lang.reflect.InvocationTargetException;
//import java.lang.reflect.Method;
//import java.lang.reflect.Field;
//
//import boggle.*;
//import dictionary.Dictionary;
//import org.junit.jupiter.api.AfterEach;
//import org.junit.jupiter.api.BeforeAll;
//import org.junit.jupiter.api.BeforeEach;
//import org.junit.jupiter.api.Test;
//
//import static org.junit.jupiter.api.Assertions.*;
//
//public class BoggleTests {
//
// //BoggleGame Test
// @Test
// void findAllWords_small() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
// BoggleGame game = new BoggleGame();
// Method method = game.getClass().getDeclaredMethod("findAllWords", Map.class, Dictionary.class, BoggleGrid.class);
// method.setAccessible(true);
//
// Dictionary boggleDict = new Dictionary("wordlist.txt");
// Map<String, ArrayList<Position>> allWords = new HashMap<>();
// BoggleGrid grid = new BoggleGrid(4);
// grid.initalizeBoard("RHLDNHTGIPHSNMJO");
// Object r = method.invoke(game, allWords, boggleDict, grid);
//
// Set<String> expected = new HashSet<>(Arrays.asList("GHOST", "HOST", "THIN"));
// assertEquals(expected, allWords.keySet());
// }
//
// //Dictionary Test
// @Test
// void containsWord() {
// Dictionary dict = new Dictionary("./wordlist.txt");
// assertTrue(dict.containsWord("ENZYME"));
// assertFalse(dict.containsWord("ENZYMEasd"));
// assertTrue(dict.isPrefix("pench"));
// assertFalse(dict.isPrefix("zx"));
// }
//
// //BoggleGrid Test
// @Test
// void setupBoard() {
// BoggleGrid grid = new BoggleGrid(10);
// String letters = "";
// for (int i = 0; i < 10; i++) {
// letters = letters + "0123456789";
// }
//
// grid.initalizeBoard(letters);
//
// for (int i = 0; i < 10; i++) {
// for (int j = 0; j < 10; j++) {
// assertEquals(letters.charAt(i*10+j), grid.getCharAt(i, j));
// }
// }
// }
//
// //BoggleStats Test
// @Test
// void endRoundTest() {
// BoggleStats stats = new BoggleStats();
// stats.endRound();
// stats.endRound();
// stats.endRound();
// assertEquals(3, stats.getRound());
// }
//
//}
//}