Esempio n. 1
0
        public void MovingLeftAndLeavingBoard()
        {
            var l = new Location(0, 0);
            var moveAvailabilityChain = new MoveAvailabilityChain(l, Direction.Left, team, board);

            Assert.False(moveAvailabilityChain.ActionAvailable());
        }
Esempio n. 2
0
        public void BlueMovingUpToRedGoal()
        {
            var l = new Location(0, 5);
            var moveAvailabilityChain = new MoveAvailabilityChain(l, Direction.Up, team, board);

            Assert.False(moveAvailabilityChain.ActionAvailable());
        }
Esempio n. 3
0
        public void RedMovingDownToBlueGoal()
        {
            var l = new Location(0, 2);
            var moveAvailabilityChain = new MoveAvailabilityChain(l, Direction.Down, opposingTeam, board);

            Assert.False(moveAvailabilityChain.ActionAvailable());
        }
Esempio n. 4
0
        public void MovingUpAndLeavingBoard()
        {
            var l = new Location(0, 7);
            var moveAvailabilityChain = new MoveAvailabilityChain(l, Direction.Up, opposingTeam, board);

            Assert.False(moveAvailabilityChain.ActionAvailable());
        }
Esempio n. 5
0
        protected override bool Validate()
        {
            var playerInfo = Board.Players[PlayerId];

            var actionAvailability = new MoveAvailabilityChain(playerInfo.Location, _direction, playerInfo.Team, Board);

            return(actionAvailability.ActionAvailable());
        }
Esempio n. 6
0
        public void MovingLeftToFieldWithPlayer()
        {
            var moveAvailabilityChain = new MoveAvailabilityChain(locationFail, Direction.Left, team, board);

            Assert.False(moveAvailabilityChain.ActionAvailable());
        }
Esempio n. 7
0
        public void MoveAvailableUp()
        {
            var moveAvailabilityChain = new MoveAvailabilityChain(locationSuccess, Direction.Up, team, board);

            Assert.True(moveAvailabilityChain.ActionAvailable());
        }