public void Test_CheckMove_ResultUpRight_BlockBy() { // Init Game CustomGame customGame = InitGame(); // Position of cell origin int xOrigin = 0; int yOrigin = 7; // Set Origin 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 = 1; int yDestination = 5; // Set destination Cell cellDestination = (Cell)customGame.Board.Board[xDestination, yDestination]; cellDestination.CellType = CellType.Fish; // Position of cell after int xAfter = 2; int yAfter = 4; // Set After Cell cellAfter = (Cell)customGame.Board.Board[xAfter, yAfter]; cellAfter.CellType = CellType.Water; //Launch move Movements move = new Movements(cellOrigin, cellDestination, customGame.Board); var result = move.GetCoordinates(); // Tests move.GetCoordinatesUpRight(result["origin"]); Assert.IsTrue(move.Possibilities[0].X == 1 && move.Possibilities[0].Y == 6); Assert.IsTrue(move.Possibilities[1].X == 1 && move.Possibilities[1].Y == 5); }
public void Test_CheckMove_ResultUpRight_AllRow() { CustomGame customGame = InitGame(); // Position of cell int xOrigin = 0; int yOrigin = 7; 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 = 4; int yDestination = 0; // Set destination Cell cellDestination = (Cell)customGame.Board.Board[xDestination, yDestination]; cellDestination.CellType = CellType.Fish; // Launch move Movements move = new Movements(cellOrigin, cellDestination, customGame.Board); var result = move.GetCoordinates(); // Tests move.GetCoordinatesUpRight(result["origin"]); Assert.IsTrue(move.Possibilities[0].X == 1 && move.Possibilities[0].Y == 6); Assert.IsTrue(move.Possibilities[1].X == 1 && move.Possibilities[1].Y == 5); Assert.IsTrue(move.Possibilities[2].X == 2 && move.Possibilities[2].Y == 4); Assert.IsTrue(move.Possibilities[3].X == 2 && move.Possibilities[3].Y == 3); Assert.IsTrue(move.Possibilities[4].X == 3 && move.Possibilities[4].Y == 2); Assert.IsTrue(move.Possibilities[5].X == 3 && move.Possibilities[5].Y == 1); Assert.IsTrue(move.Possibilities[6].X == 4 && move.Possibilities[6].Y == 0); }