Exemplo n.º 1
0
        public void RoverStartingAtZeroZeroNGivenRFacesE()
        {
            var start = new Position(0, 0, Orientation.N);
            var rover = new Rover(start);

            rover.Go("R");

            Assert.AreEqual(Orientation.E, rover.Position.Facing);
        }
Exemplo n.º 2
0
        public void RoverStartingAtZeroZeroNGivenMFinishesAtZeroOne()
        {
            var start = new Position(0, 0, Orientation.N);
            var rover = new Rover(start);

            rover.Go("M");

            Assert.AreEqual(0, rover.Position.X);
            Assert.AreEqual(1, rover.Position.Y);
        }
Exemplo n.º 3
0
        public void RoverStartingAtZeroZeroNGivenRMMLMFinishesAtTwoOneFacingN()
        {
            var start = new Position(0, 0, Orientation.N);
            var rover = new Rover(start);

            rover.Go("RMMLM");

            Assert.AreEqual(2, rover.Position.X);
            Assert.AreEqual(1, rover.Position.Y);
            Assert.AreEqual(Orientation.N, rover.Position.Facing);
        }