public void Test_CheckMove_ResultLeft_AllRow() { CustomGame customGame = InitGame(); // Position of cell origin int xOrigin = 7; 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 destination int xDestination = 0; int yDestination = 0; // Set destination cell Cell cellDestination = (Cell)customGame.Board.Board[xDestination, yDestination]; cellDestination.CellType = CellType.Fish; //launch movement Movements move = new Movements(cellOrigin, cellDestination, customGame.Board); var result = move.GetCoordinates(); // Tests move.GetCoordinatesLeft(result["origin"]); Assert.IsTrue(move.Possibilities[0].X == 6 && move.Possibilities[0].Y == 0); Assert.IsTrue(move.Possibilities[1].X == 5 && move.Possibilities[1].Y == 0); Assert.IsTrue(move.Possibilities[2].X == 4 && move.Possibilities[2].Y == 0); Assert.IsTrue(move.Possibilities[3].X == 3 && move.Possibilities[3].Y == 0); Assert.IsTrue(move.Possibilities[4].X == 2 && move.Possibilities[4].Y == 0); Assert.IsTrue(move.Possibilities[5].X == 1 && move.Possibilities[5].Y == 0); Assert.IsTrue(move.Possibilities[6].X == 0 && move.Possibilities[6].Y == 0); }
public void Test_CheckMove_ResultLeft_BlockBy() { CustomGame customGame = InitGame(); // Position of cell origin int xOrigin = 7; int yOrigin = 0; Cell cellOrigin = (Cell)customGame.Board.Board[xOrigin, yOrigin]; cellOrigin.CellType = CellType.FishWithPenguin; cellOrigin.CurrentPenguin = new Penguin(new Player("Player1", PlayerType.Human)); // Position of cell destination int xDestination = 5; int yDestination = 0; Cell cellDestination = (Cell)customGame.Board.Board[xDestination, yDestination]; cellDestination.CellType = CellType.Fish; // Position of cell after int xAfter = 4; int yAfter = 0; Cell cellAfter = (Cell)customGame.Board.Board[xAfter, yAfter]; cellAfter.CellType = CellType.Water; Movements move = new Movements(cellOrigin, cellDestination, customGame.Board); var result = move.GetCoordinates(); move.GetCoordinatesLeft(result["origin"]); Assert.IsTrue(move.Possibilities[0].X == 6 && move.Possibilities[0].Y == 0); Assert.IsTrue(move.Possibilities[1].X == 5 && move.Possibilities[1].Y == 0); }