예제 #1
0
 public void InvertGrid_NoError_GridInverted()
 {
     IBasicPokemonToken[,] pokemonToInvert = new IBasicPokemonToken[3, 3];
     pokemonToInvert[0, 0] = new BulbasaurToken();
     pokemonToInvert[0, 1] = new BulbasaurToken();
     pokemonToInvert[0, 2] = new BulbasaurToken();
     pokemonToInvert[1, 0] = new CharmanderToken();
     pokemonToInvert[1, 1] = new CharmanderToken();
     pokemonToInvert[1, 2] = new CharmanderToken();
     pokemonToInvert[2, 0] = new BulbasaurToken();
     pokemonToInvert[2, 1] = new BulbasaurToken();
     pokemonToInvert[2, 2] = new BulbasaurToken();
     IBasicPokemonToken[,] invertedPokemon = new IBasicPokemonToken[3, 3];
     invertedPokemon[0, 0] = new BulbasaurToken();
     invertedPokemon[0, 1] = new CharmanderToken();
     invertedPokemon[0, 2] = new BulbasaurToken();
     invertedPokemon[1, 0] = new BulbasaurToken();
     invertedPokemon[1, 1] = new CharmanderToken();
     invertedPokemon[1, 2] = new BulbasaurToken();
     invertedPokemon[2, 0] = new BulbasaurToken();
     invertedPokemon[2, 1] = new CharmanderToken();
     invertedPokemon[2, 2] = new BulbasaurToken();
     GridOperations.invertGrid(pokemonToInvert);
     Assert.AreEqual(pokemonToInvert, invertedPokemon);
 }
예제 #2
0
 public void MarkAllTokensOfTheSameTypeAsNull_ValidTokenType_TokensMarkedAsNull()
 {
     IBasicPokemonToken bulba = new BulbasaurToken();
     for (int row = 0; row < PokemonBoard.gridSize; row++)
     {
         for (int col = 0; col < PokemonBoard.gridSize; col++)
         {
             if (_pokemonGrid[row, col].isSameSpecies(bulba))
             {
                 _pokemonGrid[row, col] = null;
             }
         }
     }
     _pokemonBoard.markAllTokensOfSameTypeAsNull(bulba);
     Assert.AreEqual(_pokemonGrid, _pokemonBoard.NewPokemonGrid);
 }
예제 #3
0
 public void resetPokemonGrid()
 {
     for (int i = 0; i < 8; i += 2)
     {
         for (int j = 0; j < 8; j += 2)
         {
             _pokemonGrid[i, j] = new BulbasaurToken();
             _pokemonGrid[i + 1, j] = new CharmanderToken();
             _pokemonGrid[i + 1, j + 1] = new BulbasaurToken();
             _pokemonGrid[i, j + 1] = new CharmanderToken();
         }
     }
 }