Testing Databases

Learn how to write tests in order to test databases.

We were able to refactor this class so that most of its code doesn’t directly interact with a QuestionController instance, which in turn lets us write fast tests for the bulk of its logic. We were left with one method, questionText(), that interacts with a controller object. Let’s test that method:

Get hands-on with 1200+ tech skills courses.