Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Mars Rover - Moving Forward Example
using NUnit;
using System;
namespace MarsRover.UnitTests.RoverTests
public class WhenMovingForward()
public void AndFacingNorthThenYIncreasesByOne()
// Arrange
var rover = new Rover { Orientation = Direction.North };
var initialLocation = rover.Location;
// Act
// 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