Specification – single commands

Let's start with the command argument, that only has the f (forwards) character:

public void whenReceiveCommandsFThenForward() {
  Location expected = location.copy();
  expected.forward();
  ship.receiveCommands("f");
  assertEquals(ship.getLocation(), expected);
}

This specification is almost the same as the whenMoveForwardThenForward specification except that, this time, we're invoking the ship.receiveCommands("f") method.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.107.193