-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoardSetupTest.java
More file actions
90 lines (71 loc) · 2.01 KB
/
BoardSetupTest.java
File metadata and controls
90 lines (71 loc) · 2.01 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
83
84
85
86
87
88
89
90
import static org.junit.jupiter.api.Assertions.*;
import cs3500.pa03.BoardSetup;
import java.io.InputStream;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
class BoardSetupTest {
BoardSetup bs;
Readable read;
Appendable append;
@BeforeEach
void setUp() {
}
@Test
void setupBoard() {
// ByteArrayInputStream input = new ByteArrayInputStream(" 7 \n 9 \n".getBytes());
// System.setIn(input);
// ByteArrayOutputStream outputStream = new ByteArrayOutputStream(2048);
// System.setOut(new PrintStream(outputStream));
//
// Scanner scanner = new Scanner(System.in);
// String str = scanner.next();
// StringReader read = new StringReader(str);
// StringBuilder append = new StringBuilder(str);
//
// BoardSetup bs = new BoardSetup(read, append);
// bs.setupBoard();
// assertEquals(7, bs.getHeight());
// assertEquals(6, bs.getWidth());
// ByteArrayInputStream input = new ByteArrayInputStream("7\n6\n8\n".getBytes());
// System.setIn(input);
// ByteArrayOutputStream outputStream = new ByteArrayOutputStream(2048);
// System.setOut(new PrintStream(outputStream));
// read = new StringReader(input.toString());
// append = new StringBuilder(read.toString());
// BoardSetup bs = new BoardSetup(read, append);
// bs.setupBoard();
// assertEquals(7, bs.getHeight());
// assertEquals(6, bs.getWidth());
InputStream restoreBackup = System.in;
}
@Test
void getHeight() {
bs = new BoardSetup(6,6, 4);
assertEquals(6, bs.getHeight());
}
@Test
void getWidth() {
bs = new BoardSetup(6,6, 4);
assertEquals(6, bs.getWidth());
}
@Test
void getCarrier() {
bs = new BoardSetup(6,6, 4);
assertEquals(4, bs.getTotalShips());
}
@Test
void getBattleship() {
}
@Test
void getDestroyer() {
}
@Test
void getSubmarine() {
}
@Test
void setTotalShips() {
}
@Test
void getTotalShips() {
}
}