I was looking into additional ways to test ASP.NET MVC applications and ran into Steve Sanderson’s MvcIntegrationTestFramework. The approach looks rather promising but I was wondering if anyone had any actual experience to share.
相关问题
- MVC-Routing,Why i can not ignore defaults,The matc
- parameters in routing do not work MVC 3
- TestCafe - The browser always starts in clean slat
- There is no ViewData item with the key 'taskTy
- MongoError: pool is draining, new operations prohi
相关文章
- Web Test recorder does not allow me to record a te
- How to get a list of connected clients on SignalR
- How do you redirect to the calling page in ASP.NET
- Factory_girl has_one relation with validates_prese
- Change color of bars depending on value in Highcha
- The program '[4432] iisexpress.exe' has ex
- ASP.Net MVC 4 Bundles
- How to get server path of physical path ?
After reading ardave's answer a while ago, we actually went to try it out for ourselves for our new Orchard based application Marinas.info.
First of all, I recommend anyone to start from a fork of this version as it's even easier to set up than the original.
For any "normal" MVC3 app it simply works. Unfortunately, together with Orchard it didn't play well, at least not with an unmodified version of their Global.asax.cs. So we still went down the browser based testing road but we keep using it to execute Orchard commands inside the app which is fast enough.
Experimented with it a little and it could be very useful in some situations. General thumbs up and if I saw further work on it I would use on a future project.
Didn't proceed as already have WatIn setup and taking care of some things I wouldn't like to tackle again in this framework. E.g. authentication through a dialog, which would probably require a code change.
I'm having some really good results from it. I don't care what anyone else on here says about the need to test views, as soon as you add your first line of code to a view, even if the code is strictly presentation-related, you introduce a potential for errors for which it would be a good idea to write automated tests. My primary interest is just to catch as many white screen and yellow screen exception/errors as possible. To do so I have been using the snippet from Steven's introductory blog post to ensure that the page rendered properly without throwing any exceptions:
The small pitfalls that I see with this framework might be:
var result = browsingSession.ProcessRequest("/account/logon", HttpVerbs.Post, new NameValueCollection { {"UserName","myName"}, {"Password", "myPassword"}, {"returnUrl", "/home/myActionMethod"} });
I haven't used this framework. But based on my experience of reading his book -Pro ASP.NET MVC Framework, and another validation framework xVal he developed, I would say "HE IS GREAT".