Пример #1
0
        public void Test_CheckMove_ResultDownLeft_BlockBy()
        {
            CustomGame customGame = InitGame();

            // Position of cell origin
            int xOrigin = 7;
            int yOrigin = 0;

            // 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 = 5;
            int yDestination = 3;

            // Set Destination
            Cell cellDestination = (Cell)customGame.Board.Board[xDestination, yDestination];

            cellDestination.CellType = CellType.Fish;

            // Position of cell after
            int xAfter = 5;
            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.GetCoordinatesDownLeft(result["origin"]);
            Assert.IsTrue(move.Possibilities[0].X == 6 && move.Possibilities[0].Y == 1);
            Assert.IsTrue(move.Possibilities[1].X == 6 && move.Possibilities[1].Y == 2);
            Assert.IsTrue(move.Possibilities[2].X == 5 && move.Possibilities[2].Y == 3);
        }