public void Explorer_ValidateNullRovers_ReturnsFalse()
 {
     MarsExplorer x = new MarsExplorer(new Plateau() { Width = 1, Height = 1 },null);
     
     bool result = x.Validate();
     Assert.AreEqual(result, false);
 }
 public void Explorer_ValidatePlateuSpecsNonPositive_ReturnsFalse(int w, int h)
 {
     MarsExplorer x = new MarsExplorer(new Plateau() { Width = h, Height = h },
         new List<Rover> { });
     
     bool result = x.Validate();
     Assert.AreEqual(result, false);
 }
        private MarsExplorer Build(int width, int height, int startX, int startY, Orientation oreintation)
        {
            MarsExplorer x = new MarsExplorer(new Plateau() { Width = width, Height = height },
                new List<Rover>() {
                new Rover()
                {
                     Position = new RoverPosition()
                     {
                          X = startX,
                          Y = startY,
                          Orientation = oreintation
                     }
                }
            });            

            return x;
        }
        public void Explorer_ValidateRoverOutsidePlateu_ReturnsFalse(int x, int y)
        {
            MarsExplorer mx = new MarsExplorer(new Plateau() { Width = 10, Height = 10 },
                new List<Rover>() {
                new Rover()
                {
                     Position = new RoverPosition()
                     {
                          X = x,
                          Y = y
                     }
                }
            });
            

            bool result = mx.Validate();
            Assert.AreEqual(result, false);
        }
Beispiel #5
0
 internal static ParsePreparationResult CreateValidResult(MarsExplorer explorer)
 {
     return new ParsePreparationResult()
     {
         IsSuccess = true,
         Explorer = explorer
     };
 }
 public void Explorer_ValidateEmptyContent_ReturnsFalse()
 {
     MarsExplorer x = new MarsExplorer(null,null);
     bool result = x.Validate();
     Assert.AreEqual(result, false);
 }