D'Arcy from Winnipeg
Solution Architecture, Business & Entrepreneurship, Microsoft, and Adoption

Ivanna Test ASP.NET Webforms A Lot!

Friday, April 18, 2008 2:51 AM

Schott Hanselman twittered tonight about a tool he came across called Ivanna. It's a unit-testing tool for web forms...not the MVC framework based stuff but the 'old school' front-controller based ones that are still obviously in the majority of aspx applications.

As this blog post shows, the idea is that you create an instance of the page in your unit test, populate the controls via code, execute a postback, and then assert that the values in the controls are what you expected.

The example used isn't (IMO) the best one though. Ideally you wouldn't be writing a test to ensure that your calculation method was working properly by testing inputs/outputs on controls; you'd just write your test for the actual calculation method. I don't think the author's intent was to suggest that's any sort of recommended use though, just a demo. Still, don't get confused: you would still want to separate your logic into testable methods that can have unit tests wrapped around them.

But as another tool that you can add to ensure end-to-end predictability (i.e. sure your calculation code works, but does your presentation code assign values and render things properly?), this has a lot of potential.

D




Feedback

No comments posted yet.


Post a comment