Simplify duplicate command types

This commit is contained in:
Marc Di Luzio 2020-06-06 12:45:45 +01:00
parent 97d3583384
commit e3ce87e964
8 changed files with 28 additions and 56 deletions

View file

@ -23,8 +23,8 @@ func TestCommand_Move(t *testing.T) {
bearing := North
duration := 1
// Try the move command
moveCommand := world.CommandMove(a, bearing, duration)
assert.NoError(t, world.Execute(moveCommand), "Failed to execute move command")
moveCommand := Command{Command: CommandMove, Bearing: bearing.String(), Duration: duration}
assert.NoError(t, world.Execute(a, moveCommand), "Failed to execute move command")
newpos, err := world.RoverPosition(a)
assert.NoError(t, err, "Failed to set position for rover")