コード例 #1
0
        public void RotateRight_Should_Move_Forward_Method_When_Expected_Value()
        {
            //Arrange
            var eastStrategy = new WestStrategy();

            //Act
            var result = eastStrategy.RotateRight();

            //Assert
            result.Should().Be(Direction.North);
        }
コード例 #2
0
        public void MoveForward_Should_Move_Forward_Method_When_Expected_Value(int x, int y, int newX, int newY)
        {
            //Arrange
            var roverPositionModel = new RoverPositionModel
            {
                X         = x,
                Y         = y,
                Direction = Direction.East
            };
            var eastStrategy = new WestStrategy();
            //Act
            var result = eastStrategy.MoveForward(roverPositionModel);

            //Assert
            result.X.Should().Be(newX);
            result.Y.Should().Be(newY);
        }