-
-
Save cameronpresley/8b71ed90bcab7e9b5ba91fc19b438627 to your computer and use it in GitHub Desktop.
Mars Rover - Moving Forward Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using NUnit; | |
using System; | |
namespace MarsRover.UnitTests.RoverTests | |
{ | |
[TestFixture] | |
public class WhenMovingForward() | |
{ | |
[Test] | |
public void AndFacingNorthThenYIncreasesByOne() | |
{ | |
// Arrange | |
var rover = new Rover { Orientation = Direction.North }; | |
var initialLocation = rover.Location; | |
// Act | |
rover.MoveForward(); | |
// Assert | |
var expectedLocation = new Coordinate {X=initialLocation.X, Y=initialLocation.Y+1}; | |
Assert.AreEqual(expectedLocation, initialLocation); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment