Implementation

The implementation of this specification should be fairly easy. All we need to do is set the constructor argument to the location variable:

public class Ship {
  private final Location location;

public Ship(Location location) {
this.location = location; }

public Location getLocation() {
return location;
}
}

The full source can be found in the req01-location branch of the tdd-java-ch04-ship repository (https://bitbucket.org/vfarcic/tdd-java-ch04-ship/branch/req01-location).

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

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