Пример #1
0
 public void TurnTest()
 {
     var testRover = new Rover("test1", new Position() { X = 0, Y = 0 }, OrientationEnum.E, new MockComModule(),
         new MockTerrain() { Grid = new IRover[5, 5] });
     testRover.Turn(Direction.Left);
     var expectedOrientation = OrientationEnum.N;
     Assert.AreEqual(testRover.Orientation, expectedOrientation);
     testRover.Turn(Direction.Left);
     expectedOrientation = OrientationEnum.W;
     Assert.AreEqual(testRover.Orientation, expectedOrientation);
     testRover.Turn(Direction.Left);
     expectedOrientation = OrientationEnum.S;
     Assert.AreEqual(testRover.Orientation, expectedOrientation);
     testRover.Turn(Direction.Left);
     expectedOrientation = OrientationEnum.E;
     Assert.AreEqual(testRover.Orientation, expectedOrientation);
     testRover.Turn(Direction.Right);
     expectedOrientation = OrientationEnum.S;
     Assert.AreEqual(testRover.Orientation, expectedOrientation);
     testRover.Turn(Direction.Right);
     expectedOrientation = OrientationEnum.W;
     Assert.AreEqual(testRover.Orientation, expectedOrientation);
     testRover.Turn(Direction.Right);
     expectedOrientation = OrientationEnum.N;
     Assert.AreEqual(testRover.Orientation, expectedOrientation);
     testRover.Turn(Direction.Right);
     expectedOrientation = OrientationEnum.E;
     Assert.AreEqual(testRover.Orientation, expectedOrientation);
 }
Пример #2
0
        public void Turn_CanTurnLeft()
        {
            _rover.Turn(TurnDirection.Left);

            Assert.AreEqual(Orientation.East, _rover.Orientation);
        }