예제 #1
0
        public void NulliShootPosition()
        {
            var positionValidator = new PositionValidator();
            var player            = new Player();
            var columnSize        = 10;
            var rowSize           = 10;

            bool result = positionValidator.IsShootOk(null, columnSize, rowSize, player);

            result.Should().BeFalse();
        }
예제 #2
0
        public void OutOfBoundX()
        {
            var positionValidator = new PositionValidator();

            var player         = new Player();
            var iShootPosition = new Position(11, 0);
            var columnSize     = 10;
            var rowSize        = 10;

            bool result = positionValidator.IsShootOk(iShootPosition, columnSize, rowSize, player);

            result.Should().BeFalse();
        }
예제 #3
0
        public void NegativeYPosition()
        {
            var positionValidator = new PositionValidator();

            var player         = new Player();
            var iShootPosition = new Position(0, -1);
            var columnSize     = 10;
            var rowSize        = 10;

            bool result = positionValidator.IsShootOk(iShootPosition, columnSize, rowSize, player);

            result.Should().BeFalse();
        }
예제 #4
0
        public void CorrectlyPosition()
        {
            var positionValidator = new PositionValidator();

            var player = new Player();

            player.Positions = new List <Position>();
            player.Hits      = new List <Hit>();
            var iShootPosition = new Position(1, 2);

            var columnSize = 10;
            var rowSize    = 10;

            bool result = positionValidator.IsShootOk(iShootPosition, columnSize, rowSize, player);

            result.Should().BeTrue();
        }