Exemplo n.º 1
0
        public void Index()
        {
            var surface = new Plateau(5, 5);
            var rover1  = new RoverOperation(surface, "1 2 N", "LMLMLMLMM");
            var rover2  = new RoverOperation(surface, "3 3 E", "MMRMMRMRRM");


            // Assert
            Assert.IsTrue(rover1.XCoordinate == 1, "RoverOne: X = 1");
            Assert.IsTrue(rover1.YCoordinate == 3, "RoverOne: Y = 3");
            Assert.IsTrue(rover1.Direction == "N", "RoverOne: Direction = North");

            Assert.IsTrue(rover2.XCoordinate == 5, "RoverTwo: X != 5");
            Assert.IsTrue(rover2.YCoordinate == 1, "RoverTwo: Y != 1");
            Assert.IsTrue(rover2.Direction == "E", "RoverTwo: Direction = East");
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var surface = new Plateau(5, 5);
            var rover1  = new RoverOperation(surface, "1 2 N", "LMLMLMLMM");
            var rover2  = new RoverOperation(surface, "3 3 E", "MMRMMRMRRM");

            Console.WriteLine("Rover 1");

            Console.WriteLine("XCoordinate : " + rover1.XCoordinate);
            Console.WriteLine("YCoordinate : " + rover1.YCoordinate);
            Console.WriteLine("Direction : " + rover1.Direction);

            Console.WriteLine("Rover 2");

            Console.WriteLine("XCoordinate : " + rover2.XCoordinate);
            Console.WriteLine("YCoordinate : " + rover2.YCoordinate);
            Console.WriteLine("Direction : " + rover2.Direction);
        }