public void EvolveToken_RowOfSix_TokenReplacedWithSecondEvolution()
 {
     _pokemonGrid[0, 0] = new TotodileToken();
     _pokemonBoard.PokemonGrid = _pokemonGrid;
     _pokemonGrid[0, 0] = new FeraligatorToken();
     _pokemonBoard.evolveToken(0, 0, 6);
     Assert.AreEqual(_pokemonGrid[0, 0], _pokemonBoard.NewPokemonGrid[0, 0]);
 }
 public void EvolveToken_RowOfFour_TokenReplacedWithFirstEvolution()
 {
     _pokemonGrid[0, 0] = new TotodileToken();
     _pokemonBoard.PokemonGrid = _pokemonGrid;
     _pokemonGrid[0, 0] = new CroconawToken();
     _pokemonBoard.evolveToken(0, 0, 4);
     Assert.AreEqual(_pokemonGrid[0, 0], _pokemonBoard.NewPokemonGrid[0, 0]);
 }
 public void AreMovesLeft_MovesLeftInRow_ReturnTrue()
 {
     int row;
     int col;
     _pokemonGrid[0, 0] = new PichuToken();
     _pokemonGrid[0, 1] = new TotodileToken();
     _pokemonGrid[0, 2] = new TotodileToken();
     _pokemonGrid[1, 0] = new TotodileToken();
     _pokemonBoard.PokemonGrid = _pokemonGrid;
     Assert.IsTrue(_pokemonBoard.areMovesLeft(_pokemonGrid, out row, out col));
     Assert.AreEqual(0, row);
     Assert.AreEqual(0, col);
 }
 public void UpdateSingleRow_RowOfThreeStartFromRight_NullifyRowAndEvolveToken()
 {
     _pokemonGrid[0, 0] = new TotodileToken();
     _pokemonGrid[0, 1] = new TotodileToken();
     _pokemonGrid[0, 2] = new TotodileToken();
     _mockBoard.PokemonGrid = _pokemonGrid;
     _mockBoard.Expect(g => g.markNullRow(0, 0, 3));
     _mockBoard.Expect(g => g.evolveToken(0, 2, 3));
     _mockBoard.Replay();
     _mockBoard.updateSingleRow(0, 2);
     _mockBoard.VerifyAllExpectations();
 }
 public void UpdateSingleRow_RowOfThreeStartFromLeft_NullifyRowEvolveTokenAndStartPlay()
 {
     bool startedPlay = false;
     _pokemonGrid[0, 0] = new TotodileToken();
     _pokemonGrid[0, 1] = new TotodileToken();
     _pokemonGrid[0, 2] = new TotodileToken();
     _mockBoard.PokemonGrid = _pokemonGrid;
     _mockBoard.StartingPlay += delegate { startedPlay = true; };
     _mockBoard.Expect(g => g.markNullRow(0, 0, 3));
     _mockBoard.Expect(g => g.evolveToken(0, 0, 3));
     _mockBoard.Replay();
     _mockBoard.updateSingleRow(0, 0);
     _mockBoard.VerifyAllExpectations();
     Assert.IsTrue(startedPlay);
 }
 public void UpdateAllRows_RowOfThreeOnRightEdge_RowMarkedAsNull()
 {
     _pokemonGrid[0, 5] = new TotodileToken();
     _pokemonGrid[0, 6] = new TotodileToken();
     _pokemonGrid[0, 7] = new TotodileToken();
     _pokemonBoard.PokemonGrid = _pokemonGrid;
     _pokemonGrid[0, 5] = null;
     _pokemonGrid[0, 6] = null;
     _pokemonGrid[0, 7] = null;
     _pokemonBoard.updateAllRows();
     Assert.AreEqual(_pokemonGrid, _pokemonBoard.NewPokemonGrid);
 }
 public void UpdateAllRows_RowOfSix_MarkSpecialsAndRow()
 {
     _pokemonGrid[0, 2] = new TotodileToken();
     _pokemonGrid[0, 3] = new TotodileToken();
     _pokemonGrid[0, 4] = new TotodileToken();
     _pokemonGrid[0, 5] = new TotodileToken();
     _pokemonGrid[0, 6] = new TotodileToken();
     _pokemonGrid[0, 7] = new TotodileToken();
     _mockBoard.PokemonGrid = _pokemonGrid;
     _mockBoard.Expect(g => g.markNullRow(0, 2, 6));
     _mockBoard.Expect(g => g.evolveToken(0, 2, 6));
     _mockBoard.Replay();
     _mockBoard.updateAllRows();
     _mockBoard.VerifyAllExpectations();
 }
 public void UpdateAllColumns_ColumnOfThreeOnTopEdge_ColumnMarkedAsNull()
 {
     _pokemonGrid[0, 0] = new TotodileToken();
     _pokemonGrid[1, 0] = new TotodileToken();
     _pokemonGrid[2, 0] = new TotodileToken();
     _pokemonBoard.PokemonGrid = _pokemonGrid;
     _pokemonGrid[0, 0] = null;
     _pokemonGrid[1, 0] = null;
     _pokemonGrid[2, 0] = null;
     _pokemonBoard.updateAllColumns();
     Assert.AreEqual(_pokemonGrid, _pokemonBoard.NewPokemonGrid);
 }
 public void UpdateAllColumns_ColumnOfThreeInMiddle_ColumnMarkedAsNull()
 {
     _pokemonGrid[3, 0] = new TotodileToken();
     _pokemonGrid[4, 0] = new TotodileToken();
     _pokemonGrid[5, 0] = new TotodileToken();
     _pokemonBoard.PokemonGrid = _pokemonGrid;
     _pokemonGrid[3, 0] = null;
     _pokemonGrid[4, 0] = null;
     _pokemonGrid[5, 0] = null;
     _pokemonBoard.updateAllColumns();
     Assert.AreEqual(_pokemonGrid, _pokemonBoard.NewPokemonGrid);
 }
 public void PullDownTokens_NoError_NoNullsLeftInGridBoardChangedEvoked()
 {
     bool boardChanged = false;
     _pokemonGrid[0, 0] = null;
     _pokemonGrid[2, 3] = new TotodileToken();
     _pokemonGrid[3, 3] = null;
     _pokemonGrid[7, 7] = null;
     _pokemonGrid[6, 7] = new TotodileToken();
     _pokemonBoard.BoardChanged += delegate { boardChanged = true; };
     _pokemonBoard.NewPokemonGrid = _pokemonGrid;
     _pokemonBoard.pullDownTokens();
     Assert.IsNotNull(_pokemonBoard.PokemonGrid[0, 0]);
     Assert.AreEqual(_pokemonGrid[2, 3], _pokemonBoard.PokemonGrid[3,3]);
     Assert.AreEqual(_pokemonGrid[6, 7], _pokemonBoard.PokemonGrid[7,7]);
     Assert.IsTrue(boardChanged);
 }