Production Code for Database Integration Test
Learn to drive the production code continuing the database integration test creation.
The next step is to add the missing Arrange, Act, and Assert code to the fetchesWord()
test.
Driving out the production code
Our goal is to test-drive code to fetch a word from the database. We want that code to be in a class that implements the WordRepository
interface, which we defined in the domain model. We’ll want to design enough of our database schema to support this. By starting to add code to the Assert step, we can drive out an implementation quickly. This is a useful technique— writing the test by starting with the Assert step so that we start with the desired outcome. We can then work backward to include everything necessary for delivering it:
We add the Assert step to our
fetchesWord()
test:
Get hands-on with 1400+ tech skills courses.