Ejemplo n.º 1
0
        public void GivenDirectionEast_WhenMove_ShouldDirectionEastAndXAxisIncremented()
        {
            var direction   = new East();
            var oldPosition = new Core.ValueObject.RoverPosition(3, 3, direction.Direction);
            var position    = direction.Move(oldPosition);

            Assert.Equal(position.X, oldPosition.X + 1);
            Assert.Equal(position.Y, oldPosition.Y);
        }
Ejemplo n.º 2
0
        public void When_Moving_East_At_X_Boundary_Do_Not_Pass_Boundary()
        {
            var direction = new East(_landscape);

            for (var i = 0; i < 10; i++)
            {
                direction.Move();
            }

            Assert.That(_landscape.CoordinateX, Is.EqualTo(5));
            Assert.That(_landscape.CoordinateY, Is.EqualTo(0));
        }
Ejemplo n.º 3
0
        public void Move_HeadedEast_ResultsInPositionOneToTheRight()
        {
            const int startX = 10;
            const int startY = 12;

            Direction sut = new East();

            var(newX, newY) = sut.Move(startX, startY);

            newX.Should().Be(startX + 1);
            newY.Should().Be(startY);
        }