Exemplo n.º 1
0
 public void TLocationConstructor()
 {
     MarsRover.Point point = new Point(2, 3);
     MarsRover.Direction direction = Direction.E;
     MarsRover.Location target = new MarsRover.Location(point, direction);
     Assert.AreEqual(target.ToString(), "2 3 E");
 }
Exemplo n.º 2
0
 public void TGetLocation()
 {
     string directionInput = "1 2 E";  
     MarsRover.Location expected = new Location(new Point(1, 2), Direction.E);  
     MarsRover.Location actual;
     actual = MarsRover.Location.GetLocation(directionInput);
     Assert.AreEqual(expected.ToString(), actual.ToString());
 }
Exemplo n.º 3
0
 public void TLocationConstructor2()
 {
     MarsRover.Point point = new Point(2,2);
     MarsRover.Location target = new MarsRover.Location(point);
     Assert.AreEqual(target.ToString(), "2 2 N");
 }
Exemplo n.º 4
0
 public void TGetLocation2()
 {
     try
     {
         string directionInput = string.Empty;
         MarsRover.Location expected = new Location(new Point(1, 2), Direction.E);
         MarsRover.Location actual;
         actual = MarsRover.Location.GetLocation(directionInput);
         Assert.AreEqual(expected.ToString(), actual.ToString());
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }