-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test_GameSquare.java
43 lines (33 loc) · 1.01 KB
/
Test_GameSquare.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
package tictactoe.game;
public class Test_GameSquare {
GameSquare gs = new GameSquare();
// Test_GameSquare() {
// this.gs = new GameSquare();
// }
// void print(String func) {
// }
// Test default ctor
void testDefault() {
String func = new String();
func = "testDefault";
// gs untouched right now.
System.out.printf("The entry in GameSquare for %s is: %c \n", func, gs.getMark());
assert (gs.getMark()==' ') : "Failure: testDefault has failed.";
}
// test setX()
void testEx() {
String func = "testEx";
gs.setX();
// gs modified: should have X
System.out.printf("The entry in GameSquare for %s is: %c\n", func, gs.getMark());
assert (gs.getMark()=='X') : "Failure: testEx has failed.";
}
// test setX()
void testOh() {
String func = "testOh";
gs.setO();
// gs modified: should have X
System.out.printf("The entry in GameSquare for %s is: %c\n", func, gs.getMark());
assert (gs.getMark()=='O') : "Failure: testOh has failed.";
}
}