BT

ASP.NET MVC Testing Tips and Tricks

by Roopesh Shenoy on Mar 20, 2012 |

There are several components in an ASP.NET MVC 3 web app – models, controllers, route-handlers, views, html-helpers, client-side code etc. Most of these can be unit-tested, others need integration tests, and several good practices can help you keep your tests more maintainable and avoid making them brittle.

Here are some resources -

Do you have any other testing tips you want to share for testing ASP.NET MVC applications?

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

One Suggestion: SpecsFor.Mvc! by Matt Honeycutt

I'm obviously biased, but I think you left out one of the best tools for testing ASP.NET MVC applications: SpecsFor.Mvc! It enables you to write acceptance tests that perform complex browser automation using simple, unit-test like syntax. You can check it out at specsfor.com/SpecsForMvc and on my blog at trycatchfail.com/blog/post/Using-SpecsForMvc-In....

Re: One Suggestion: SpecsFor.Mvc! by Roopesh Shenoy

Thanks for the suggestion Matt - definitely looking at it.

One concern I have is how do you reuse these test-steps? One of the greatest features in BDD frameworks seems to be that you can reuse your test steps in multiple test cases making them more efficient. Look here for instance - nbehave.codeplex.com/wikipage?title=Using%20NBe....

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

2 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT