コード例 #1
0
        public void ObstacleDownReturnsTrueTest()
        {
            // arrange
            var snakeBody = new List <SnakeElement>
            {
                new SnakeElement(9, 9, 0)
            };
            var snake            = new Snake(snakeBody, new Display());
            var map              = new Map(10, 10);
            var modelInputHelper = new ModelInputHelper();

            // act
            var actual = modelInputHelper.ObstacleDown(snake, map);

            // assert
            Assert.True(actual);
        }
コード例 #2
0
        public void ObstacleRightReturnsFalseTest()
        {
            // arrange
            var snakeBody = new List <SnakeElement>
            {
                new SnakeElement(8, 1, 0)
            };
            var snake            = new Snake(snakeBody, new Display());
            var map              = new Map(10, 10);
            var modelInputHelper = new ModelInputHelper();

            // act
            var actual = modelInputHelper.ObstacleRight(snake, map);

            // assert
            Assert.False(actual);
        }