Exemple #1
0
        public Rover(int pointX, int pointY, CardinalCompass cardinalCompass)
        {
            if (pointX < 0 || pointY < 0)
                throw new Exception("X and Y co-ordinates must be positive numbers!");

            PointX = pointX;
            PointY = pointY;
            CardinalCompass = cardinalCompass;
        }
 private void ThenIExpectARoverOnThePosition(Rover rover, int x, int y, CardinalCompass cardinal)
 {
     Assert.AreEqual(rover.PointX, x);
     Assert.AreEqual(rover.PointY, y);
     Assert.AreEqual(rover.CardinalCompass, cardinal);
 }
 private void ThenIExpectARover(Rover rover, int expectedX, int expectedY, CardinalCompass expectedCardinalCompass)
 {
     Assert.IsNotNull(rover);
     Assert.AreEqual(rover.PointX, expectedX);
     Assert.AreEqual(rover.PointY, expectedY);
     Assert.AreEqual(rover.CardinalCompass, expectedCardinalCompass);
 }
 private Rover GivenARover(int x, int y, CardinalCompass cardinal)
 {
     return new Rover(x, y, cardinal);
 }