I have a simple MVC application consisting of View->Controller->Service->Model.
My controllers are really skinny. All they do is call service method and populate the ModelAndView. Is it considered a good practice to unit tests controllers to make sure they set required properties in the ModelAndView while mocking the services completely?
At some point it would not harm to test even controllers - then you would be sure that they are calling correct service methods, passing (modifying - if any needed) request parameters properly and returning correct ModelAndView.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With