Beispiel #1
0
        private static void throwDeployException(LandingSurface aLandingSurface, MovementPoints aPoint)
        {
            var size             = aLandingSurface.GetSize();
            var exceptionMessage = string.Format("Deploy failed at point ({0},{1}). Landing zone size is {2} x {3}",
                                                 aPoint.X, aPoint.Y, size.Width, size.Height);

            throw new NotImplementedException(exceptionMessage);
        }
 public CommandCenter(LandingSurface aLandingSurface, ParseCommands aCommandParser, CommandsInvoke aCommandInvoker, IReportComposer aReportComposer)
 {
     rovers         = new List <MarsRover>();
     landingSurface = aLandingSurface;
     commandParser  = aCommandParser;
     commandInvoker = aCommandInvoker;
     reportComposer = aReportComposer;
     commandInvoker.SetLandingSurface(landingSurface);
     commandInvoker.SetRovers(rovers);
 }
Beispiel #3
0
        public void Deploy(LandingSurface aLandingSurface, MovementPoints aPoint, CardinalDirection aDirection)
        {
            if (aLandingSurface.IsValid(aPoint))
            {
                Position          = aPoint;
                CardinalDirection = aDirection;
                isDeployed        = true;
                return;
            }

            throwDeployException(aLandingSurface, aPoint);
        }
        public void Set_Size_Of_The_Exploration_Zone(int height, int width)
        {
            // Arrang
            var expectedSize   = new Size(height, width);
            var landingSurface = new LandingSurface();

            // Act
            landingSurface.SetSize(expectedSize);
            var setSize = landingSurface.GetSize();

            // Assert
            Assert.AreEqual(expectedSize, setSize);
        }
 public void SetReceivers(MarsRover aRover, LandingSurface aLandingSurface)
 {
     Rover          = aRover;
     LandingSurface = aLandingSurface;
 }
 public void SetLandingSurface(LandingSurface aLandingSurface)
 {
     LandingSurface = aLandingSurface;
 }