On a new ASP.NET MVC application we are following a TDD approach, using NUnit for unit testing and Unity for Dependancy Injection.
Our views are being made as "dumb" as possible by adjusting our models to supply data in the most appropriate fashion for our views.
Is there a merit in unit testing our views? If so - how?
The advantage of the MVC pattern is that views are supposed to be very lightweight and contain no code that needs to be tested.
If a view does contain code that needs to be tested, it should be moved out into the controller or model and unit tested there.
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