March 2018
Intermediate to advanced
324 pages
8h 30m
English
The specification for this requirement can be the following:
@Test
public class ShipSpec {
public void whenInstantiatedThenLocationIsSet() {
Location location = new Location(new Point(21, 13), Direction.NORTH);
Ship ship = new Ship(location);
assertEquals(ship.getLocation(), location);
}
}
This was an easy one. We're just checking whether the Location object we're passing as the Ship constructor is stored and can be accessed through the location getter.
Read now
Unlock full access