public void Test_CheckFreeCell_CellTypePenguin() { //Init Game CustomGame customGame = InitGame(); // Position of cell origin int xOrigin = 0; int yOrigin = 0; //Set Origin cell Cell cellOrigin = (Cell)customGame.Board.Board[xOrigin, yOrigin]; cellOrigin.CellType = CellType.FishWithPenguin; cellOrigin.CurrentPenguin = new Penguin(new Player("Player1", PlayerType.Human)); // Position of cell after int xAfter = 1; int yAfter = 0; //Set after cell Cell cellAfter = (Cell)customGame.Board.Board[xAfter, yAfter]; cellAfter.CellType = CellType.FishWithPenguin; cellAfter.CurrentPenguin = new Penguin(new Player("Player2", PlayerType.Human)); //launch function Movements move = new Movements(cellOrigin, null, customGame.Board); bool result = move.CheckFreeCell(xAfter, yAfter); //Tests Assert.IsTrue(result); }
public void Test_CheckFreeCell_CellTypeWater_ExceedBoard() { //Init Game CustomGame customGame = InitGame(); //launch function Movements move = new Movements(null, null, customGame.Board); bool result = move.CheckFreeCell(8, 8); //Tests Assert.IsTrue(result); result = move.CheckFreeCell(-1, -1); //Tests Assert.IsTrue(result); }