public void ShouldReturnSnakeHeadInitialPosition()
        {
            src.Position result = _snake.HeadPosition;
            src.Position actual = new src.Position(SnakeStub.INITIAL_XCOORDINATE, SnakeStub.INITIAL_YCOORDINATE);

            Assert.Equal(result.XCoordinate, actual.XCoordinate);
            Assert.Equal(result.YCoordinate, actual.YCoordinate);
        }
Пример #2
0
        public void ShouldGetRandomPosition()
        {
            src.Position result = _food.FoodPosition;
            src.Position actual = new src.Position();

            Assert.False(result.XCoordinate == actual.XCoordinate);
            Assert.False(result.YCoordinate == actual.YCoordinate);
        }
        public void ExpectLastBodyPieceToBeBehindHead()
        {
            List <src.Position> SnakePos = _snake.Positions;

            src.Position result = SnakePos.Last();

            int x = SnakeStub.INITIAL_XCOORDINATE - 5;
            int y = SnakeStub.INITIAL_YCOORDINATE - 5;

            src.Position actual = new src.Position(x, y);

            Assert.Equal(result.XCoordinate, actual.XCoordinate);
            Assert.Equal(result.XCoordinate, actual.YCoordinate);
        }
 public PositionTest()
 {
     _position = new src.Position(0, 0);
 }