March 2018
Intermediate to advanced
324 pages
8h 30m
English
To utilize a newly created TicTacToe constructor, we can do something such as the following:
private TicTacToeCollection collection;
@Before
public final void before() throws UnknownHostException {
collection = mock(TicTacToeCollection.class);
// ticTacToe = new TicTacToe();
ticTacToe = new TicTacToe(collection);
}
Now all our specifications will use a mocked version of the TicTacToeCollection. There are other ways to inject mocked dependencies (for example, with Spring); however, when possible, we feel that simplicity trumps complicated frameworks.
Read now
Unlock full access