1

Is there any way that can I write a unit test for Views in my ASP.NET MVC application?

I need to validate the button names, title, etc. stuff using such tests.

3
  • WatiN is the only way I can think of, however I typically think of that more as a UI or integration test than a unit test.
    – Brook
    Commented Sep 26, 2011 at 18:01
  • thanks Brook, do we have any article on this?
    – user957178
    Commented Sep 26, 2011 at 18:02
  • 1
    possible duplicate of Unit Testing the Views?
    – jrummell
    Commented Sep 26, 2011 at 18:05

1 Answer 1

3

We've used Coded-UI Tests for ASP.NET web applications. If you have the appropriate Visual Studio version, this may be on option. Ideally for MVC you can also write a lot of these tests against the controllers, which is baked in, but since you asked about Views I'm sharing the Coded UI link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.