示例#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");
 }
示例#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());
 }
示例#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");
 }
示例#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);
     }
 }