|
|
|
|
121
|
public void oneTerritoryIsWholeBoardTest() {
|
121
|
public void oneTerritoryIsWholeBoardTest() {
|
122
|
GoCounting gocounting = new GoCounting(" ");
|
122
|
GoCounting gocounting = new GoCounting(" ");
|
123
|
|
123
|
|
124
|
- HashMap<String, Set<Point>> territories = new HashMap<>();
|
|
|
|
|
124
|
+ HashMap<Player, Set<Point>> territories = new HashMap<>();
|
125
|
Set<Point> blackTerritory = new HashSet<>();
|
125
|
Set<Point> blackTerritory = new HashSet<>();
|
126
|
Set<Point> whiteTerritory = new HashSet<>();
|
126
|
Set<Point> whiteTerritory = new HashSet<>();
|
127
|
Set<Point> noneTerritory = new HashSet<>();
|
127
|
Set<Point> noneTerritory = new HashSet<>();
|
128
|
noneTerritory.add(new Point(0, 0));
|
128
|
noneTerritory.add(new Point(0, 0));
|
129
|
|
129
|
|
130
|
- territories.put("BLACK", blackTerritory);
|
|
|
131
|
- territories.put("WHITE", whiteTerritory);
|
|
|
132
|
- territories.put("NONE", noneTerritory);
|
|
|
|
|
130
|
+ territories.put(Player.BLACK, blackTerritory);
|
|
|
131
|
+ territories.put(Player.WHITE, whiteTerritory);
|
|
|
132
|
+ territories.put(Player.NONE, noneTerritory);
|
133
|
|
133
|
|
134
|
assertEquals(territories, gocounting.getTerritories());
|
134
|
assertEquals(territories, gocounting.getTerritories());
|
135
|
}
|
135
|
}
|
|
|
|
|
149
|
|
149
|
|
150
|
Set<Point> noneTerritory = new HashSet<>();
|
150
|
Set<Point> noneTerritory = new HashSet<>();
|
151
|
|
151
|
|
152
|
- HashMap<String, Set<Point>> territories = new HashMap<>();
|
|
|
153
|
- territories.put("BLACK", blackTerritory);
|
|
|
154
|
- territories.put("WHITE", whiteTerritory);
|
|
|
155
|
- territories.put("NONE", noneTerritory);
|
|
|
|
|
152
|
+ HashMap<Player, Set<Point>> territories = new HashMap<>();
|
|
|
153
|
+ territories.put(Player.BLACK, blackTerritory);
|
|
|
154
|
+ territories.put(Player.WHITE, whiteTerritory);
|
|
|
155
|
+ territories.put(Player.NONE, noneTerritory);
|
156
|
|
156
|
|
157
|
assertEquals(territories, gocounting.getTerritories());
|
157
|
assertEquals(territories, gocounting.getTerritories());
|
158
|
}
|
158
|
}
|
|
|
|
|
162
|
public void twoRegionRectangularBoardTest() {
|
162
|
public void twoRegionRectangularBoardTest() {
|
163
|
GoCounting gocounting = new GoCounting(" B ");
|
163
|
GoCounting gocounting = new GoCounting(" B ");
|
164
|
|
164
|
|
165
|
- HashMap<String, Set<Point>> territories = new HashMap<>();
|
|
|
|
|
165
|
+ HashMap<Player, Set<Point>> territories = new HashMap<>();
|
166
|
Set<Point> blackTerritory = new HashSet<>();
|
166
|
Set<Point> blackTerritory = new HashSet<>();
|
167
|
blackTerritory.add(new Point(0, 0));
|
167
|
blackTerritory.add(new Point(0, 0));
|
168
|
blackTerritory.add(new Point(2, 0));
|
168
|
blackTerritory.add(new Point(2, 0));
|
169
|
Set<Point> whiteTerritory = new HashSet<>();
|
169
|
Set<Point> whiteTerritory = new HashSet<>();
|
170
|
Set<Point> noneTerritory = new HashSet<>();
|
170
|
Set<Point> noneTerritory = new HashSet<>();
|
171
|
|
171
|
|
172
|
- territories.put("BLACK", blackTerritory);
|
|
|
173
|
- territories.put("WHITE", whiteTerritory);
|
|
|
174
|
- territories.put("NONE", noneTerritory);
|
|
|
|
|
172
|
+ territories.put(Player.BLACK, blackTerritory);
|
|
|
173
|
+ territories.put(Player.WHITE, whiteTerritory);
|
|
|
174
|
+ territories.put(Player.NONE, noneTerritory);
|
175
|
|
175
|
|
176
|
assertEquals(territories, gocounting.getTerritories());
|
176
|
assertEquals(territories, gocounting.getTerritories());
|
177
|
}
|
177
|
}
|