private void Setup() { _rover = new RoverBuilder(1).Operational(1, 1, Direction.North).Build(); _commands = new[] { Command.Move, Command.TurnRight, Command.Move }; _plateau = new Plateau(5, 5); _roverRoute = new RoverRoute(_rover, _commands); }
public void GivenARoverRouteWithInvalidInput_ShouldThrowArgumentException(Rover rover, IEnumerable <Command> commands) { Action action = () => { _ = new RoverRoute(rover, commands); }; action.Should().Throw <ArgumentException>(); }
public void GivenARoverRouteWithEmptyCommands_ShouldThrowInvalidOperationException() { var rover = new RoverBuilder(1).Operational(1, 1, Direction.North).Build(); var commands = Array.Empty <Command>(); Action action = () => { _ = new RoverRoute(rover, commands); }; action.Should().Throw <InvalidOperationException>(); }
public void GivenValidInputForARoverRoute_ShouldCreateARoverRoute() { var rover = new RoverBuilder(1).Operational(1, 1, Direction.North).Build(); var commands = new[] { Command.Move, Command.TurnRight, Command.Move, }; Action action = () => { _ = new RoverRoute(rover, commands); }; action.Should().NotThrow("Rover route was correctly created"); }