예제 #1
0
        public void Rover_Should_Be_At_0_0_N_When_FFBFFBBB_Command_Given()
        {
            // Arrange
            Domain.PlutoRover plutoRover = new Domain.PlutoRover();

            // Act
            plutoRover.ExecuteCommand("FFBFFBBB");

            // Assert
            var actualPlutoRoverPosition = plutoRover.ReportPosition();
            var expectedPlutoRoverPosition = "0,0,N";

            Assert.AreEqual(expectedPlutoRoverPosition, actualPlutoRoverPosition);
        }
예제 #2
0
        public void Rover_Should_Spin_Left_And_Keep_Same_Position_When_L_Command_Given()
        {
            // Arrange
            Domain.PlutoRover plutoRover = new Domain.PlutoRover();

            // Act
            plutoRover.ExecuteCommand("L");

            // Assert
            var actualRoverPosition = plutoRover.ReportPosition();
            var expectedRoverPosition = "0,0,W";

            Assert.AreEqual(expectedRoverPosition, actualRoverPosition);
        }
예제 #3
0
        public void Rover_Should_Move_Forward_And_Keep_Same_Heading_When_F_Command_Given()
        {
            // Arrange
            Domain.PlutoRover plutoRover = new Domain.PlutoRover();

            // Act
            plutoRover.ExecuteCommand("F");

            // Assert
            var actualPlutoRoverPosition = plutoRover.ReportPosition();
            var expectedPlutoRoverPosition = "0,1,N";

            Assert.AreEqual(expectedPlutoRoverPosition, actualPlutoRoverPosition);
        }
예제 #4
0
        public void Rover_Should_Move_Backward_And_Keep_Same_Heading_When_B_Command_Given()
        {
            // Arrange
            Domain.PlutoRover plutoRover = new Domain.PlutoRover();

            // Act
            plutoRover.ExecuteCommand("B");

            // Assert
            var actualPlutoRoverPosition = plutoRover.ReportPosition();
            var expectedPlutoRoverPosition = "0,99,N"; // I had to fix this test, potentially a Open/Close principle issue here.

            Assert.AreEqual(expectedPlutoRoverPosition, actualPlutoRoverPosition);
        }
예제 #5
0
        public void Rover_Should_Spin_Right_And_Keep_Same_Position_When_R_Command_Given()
        {
            // Arrange
            Domain.PlutoRover plutoRover = new Domain.PlutoRover();

            // Act
            plutoRover.ExecuteCommand("R");

            // Assert
            var actualRoverPosition   = plutoRover.ReportPosition();
            var expectedRoverPosition = "0,0,E";

            Assert.AreEqual(expectedRoverPosition, actualRoverPosition);
        }
예제 #6
0
        public void Rover_Should_Be_At_1_0_E_When_FLFFLFLFFF_Command_Given()
        {
            // Arrange
            Domain.PlutoRover plutoRover = new Domain.PlutoRover();

            // Act
            plutoRover.ExecuteCommand("FLFFLFLFFF");

            // Assert
            var actualRoverPosition   = plutoRover.ReportPosition();
            var expectedRoverPosition = "1,0,E";

            Assert.AreEqual(expectedRoverPosition, actualRoverPosition);
        }
예제 #7
0
        public void Rover_Should_Be_At_0_0_N_When_FFBFFBBB_Command_Given()
        {
            // Arrange
            Domain.PlutoRover plutoRover = new Domain.PlutoRover();

            // Act
            plutoRover.ExecuteCommand("FFBFFBBB");

            // Assert
            var actualPlutoRoverPosition   = plutoRover.ReportPosition();
            var expectedPlutoRoverPosition = "0,0,N";

            Assert.AreEqual(expectedPlutoRoverPosition, actualPlutoRoverPosition);
        }
예제 #8
0
        public void Rover_Should_Move_Backward_And_Keep_Same_Heading_When_B_Command_Given()
        {
            // Arrange
            Domain.PlutoRover plutoRover = new Domain.PlutoRover();

            // Act
            plutoRover.ExecuteCommand("B");

            // Assert
            var actualPlutoRoverPosition   = plutoRover.ReportPosition();
            var expectedPlutoRoverPosition = "0,99,N"; // I had to fix this test, potentially a Open/Close principle issue here.

            Assert.AreEqual(expectedPlutoRoverPosition, actualPlutoRoverPosition);
        }
예제 #9
0
        public void Rover_Should_Move_Forward_And_Keep_Same_Heading_When_F_Command_Given()
        {
            // Arrange
            Domain.PlutoRover plutoRover = new Domain.PlutoRover();

            // Act
            plutoRover.ExecuteCommand("F");

            // Assert
            var actualPlutoRoverPosition   = plutoRover.ReportPosition();
            var expectedPlutoRoverPosition = "0,1,N";

            Assert.AreEqual(expectedPlutoRoverPosition, actualPlutoRoverPosition);
        }
예제 #10
0
        public void Rover_Should_Move_On_The_Grid_As_A_Sphere()
        {
            // Arrange
            Domain.PlutoRover plutoRover = new Domain.PlutoRover();

            // Act
            plutoRover.ExecuteCommand("BBLFRR");

            // Assert
            var actualRoverPosition   = plutoRover.ReportPosition();
            var expectedRoverPosition = "99,98,E";

            Assert.AreEqual(expectedRoverPosition, actualRoverPosition);
        }
예제 #11
0
        public void Rover_Should_Be_At_1_0_E_When_FLFFLFLFFF_Command_Given()
        {
            // Arrange
            Domain.PlutoRover plutoRover = new Domain.PlutoRover();

            // Act
            plutoRover.ExecuteCommand("FLFFLFLFFF");

            // Assert
            var actualRoverPosition = plutoRover.ReportPosition();
            var expectedRoverPosition = "1,0,E";

            Assert.AreEqual(expectedRoverPosition, actualRoverPosition);
        }
예제 #12
0
        public void Rover_Should_Move_On_The_Grid_As_A_Sphere()
        {
            // Arrange
            Domain.PlutoRover plutoRover = new Domain.PlutoRover();

            // Act
            plutoRover.ExecuteCommand("BBLFRR");

            // Assert
            var actualRoverPosition = plutoRover.ReportPosition();
            var expectedRoverPosition = "99,98,E";

            Assert.AreEqual(expectedRoverPosition, actualRoverPosition);
        }