public void givenMixedCommandsThatMakeASquareReturnToStartingLocationGoingRight() { int[] location = { 50, 50 }; char direction = 'e'; int[] grid = { 100, 100 }; string commands = "rfrfrfrf"; int[] expected = new int[] { 50, 50 }; int[] output = new MarsRoverMovementClass().RovingRover(location, direction, grid, commands); Assert.AreEqual(expected, output); }
public void givenInputsWithCommandLeftReturnNewLocation() { int[] location = { 50, 50 }; char direction = 'e'; int[] grid = { 100, 100 }; string commands = "fflf"; int[] expected = new int[] { 49, 52 }; int[] output = new MarsRoverMovementClass().RovingRover(location, direction, grid, commands); Assert.AreEqual(expected, output); }
public void givenInputsThatRequireWrappingOnYAxisReturnCorrectLocation() { int[] location = { 0, 0 }; char direction = 'n'; int[] grid = { 100, 100 }; string commands = "f"; int[] expected = new int[] { 100, 0 }; int[] output = new MarsRoverMovementClass().RovingRover(location, direction, grid, commands); Assert.AreEqual(expected, output); }
public void givenInputsWitNoCommandsReturnStartingLocation() { int[] location = { 0, 0 }; char direction = 'e'; int[] grid = { 100, 100 }; string commands = "ff"; int[] expected = new int[] { 0, 2 }; int[] output = new MarsRoverMovementClass().RovingRover(location, direction, grid, commands); Assert.AreEqual(expected, output); }
public void givenAllInputsReturnAnIntArray() { int[] location = { }; char direction = 'e'; int[] grid = { }; string commands = ""; int[] expected = new int[] { }; int[] output = new MarsRoverMovementClass().RovingRover(location, direction, grid, commands); Assert.AreEqual(expected, output); }