I need advice on an efficient way to write integration tests for our current ASP.NET MVC application. Our architecture consists of:
- Service Level Below Controllers
- The service layer uses repositories and a message queue (sometimes) to send messages to external applications.
I think the following should be done:
Record behavioral unit tests for all parts separately. So, for example, we need a unit test service level, while ridiculing repositories and message queues.
The same goes for controllers. Therefore, we scoff at the level of service and unit test with the controller.
- Finally, we write separate integration tests for repositories against a real database and message queue classes against real message queues to ensure that they save / retrieve data successfully.
My questions:
Are there any other types of integration tests we need to write?
Do I still need to write integration tests for Services with real repositories and message queues?
We still need to write integration tests for controllers with real services (which, in turn, consist of real repositories and message queues).
Any advice would be greatly appreciated.
Greetings
source share