| | 154 | } |
| | 155 | |
| | 156 | #endregion |
| | 157 | |
| | 158 | #endregion |
| | 159 | |
| | 160 | #region IsEndOfGame |
| | 161 | |
| | 162 | #region 2~4人 |
| | 163 | |
| | 164 | [Test] |
| | 165 | public void IsEndOfGame_EmptySupplies_False([Range(2, 4)]int players, [Range(0, 2)]int emptySupply) |
| | 166 | { |
| | 167 | Game game = new Game(players); |
| | 168 | |
| | 169 | for (int i = 0; i < emptySupply; i++) |
| | 170 | game.supplyPiles[i].Clear(); |
| | 171 | |
| | 172 | Assert.That(game.IsEndOfGame, Is.False); |
| | 173 | } |
| | 174 | |
| | 175 | [Test] |
| | 176 | public void IsEndOfGame_EmptySupplies_True([Range(2, 4)]int players, [Range(3, 5)]int emptySupply) |
| | 177 | { |
| | 178 | Game game = new Game(players); |
| | 179 | |
| | 180 | for (int i = 0; i < emptySupply; i++) |
| | 181 | game.supplyPiles[i].Clear(); |
| | 182 | |
| | 183 | Assert.That(game.IsEndOfGame, Is.True); |
| | 184 | } |
| | 185 | |
| | 186 | [Test] |
| | 187 | public void IsEndOfGame_EmptyProvince_True([Range(2, 4)]int players) |
| | 188 | { |
| | 189 | Game game = new Game(players); |
| | 190 | |
| | 191 | game.supplyPiles.Find(cardlist => cardlist.CardInfo is Province).Clear(); |
| | 192 | |
| | 193 | Assert.That(game.IsEndOfGame, Is.True); |
| | 194 | } |
| | 195 | |
| | 196 | #endregion |
| | 197 | |
| | 198 | #region 5~6人 |
| | 199 | |
| | 200 | [Test] |
| | 201 | public void IsEndOfGame_ManyPlayers_EmptySupplies_False([Range(5, 6)]int players, [Range(0, 3)]int emptySupply) |
| | 202 | { |
| | 203 | Game game = new Game(players); |
| | 204 | |
| | 205 | for (int i = 0; i < emptySupply; i++) |
| | 206 | game.supplyPiles[i].Clear(); |
| | 207 | |
| | 208 | Assert.That(game.IsEndOfGame, Is.False); |
| | 209 | } |
| | 210 | |
| | 211 | [Test] |
| | 212 | public void IsEndOfGame_ManyPlayers_EmptySupplies_True([Range(5, 6)]int players, [Range(4, 5)]int emptySupply) |
| | 213 | { |
| | 214 | Game game = new Game(players); |
| | 215 | |
| | 216 | for (int i = 0; i < emptySupply; i++) |
| | 217 | game.supplyPiles[i].Clear(); |
| | 218 | |
| | 219 | Assert.That(game.IsEndOfGame, Is.True); |
| | 220 | } |
| | 221 | |
| | 222 | [Test] |
| | 223 | public void IsEndOfGame_ManyPlayers_EmptyProvince_True([Range(5, 6)]int players) |
| | 224 | { |
| | 225 | Game game = new Game(players); |
| | 226 | |
| | 227 | game.supplyPiles.Find(supply => supply.CardInfo is Province).Clear(); |
| | 228 | |
| | 229 | Assert.That(game.IsEndOfGame, Is.True); |