コード例 #1
0
ファイル: RoverTest.cs プロジェクト: joshisreedhar/MarsRover
        public void Rover_Which_Is_North_When_Asked_To_MoveBack_Should_Move_One_Unit_Backward_Vertically()
        {
            Orientation northOrientation = OrientationGenerator.GetOrientation (Direction.North);

            Location location = new Location (new Position (2, 3), northOrientation);
            Location expectedLocation = new Location (new Position (2, 2), northOrientation);
            Rover rover = new Rover (location);
            Location actualLocation = rover.MoveBack ();
            Assert.AreEqual (expectedLocation,actualLocation);
        }
コード例 #2
0
ファイル: RoverTest.cs プロジェクト: joshisreedhar/MarsRover
        public void Rover_Which_Is_East_When_Asked_To_MoveBack_Should_Move_One_Unit_Backward_Horizontally()
        {
            Orientation eastOrientation = OrientationGenerator.GetOrientation (Direction.East);

            Location location = new Location (new Position (2, 3), eastOrientation);
            Location expectedLocation = new Location (new Position (1, 3), eastOrientation);
            Rover rover = new Rover (location);
            Location actualLocation = rover.MoveBack ();
            Assert.AreEqual (expectedLocation,actualLocation);
        }