In this section, we are going to create tests for some question controller actions. Let's get started:
- First, we need to reference the QandA project from the Tests project. We do this by right-clicking on the Dependencies node in the Solution Explorer in the Tests project and choosing Add Reference...:
- Then, we need to tick the QandA project and click the OK button:
- Our controller has dependencies for a cache, a data repository, and a SignalR hub. Due to this, we'll need to mock these out in our tests. ...