Answer the question
In order to leave comments, you need to log in
Do you test controllers?
Actually, the question is in the topic. There are a lot of different variations, from the patient himself:
- The controller can access any kind of services, incl. external, or interact with the database, this can be ignored and unexpected changes can be made to the combat database.
- Classes are initialized in the controller and not passed by parameters (It is possible, of course, that the IoC container would help here, but it happened historically).
Answer the question
In order to leave comments, you need to log in
testing controller methods:
- for data validation (we write a test with valid and invalid data that comes)
- for calls to other methods (we write tests for different flows when the controller pulls other methods and in the test we just check if the method has jerked)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question