![]() ![]() it feels unnatural to a web forms developer. After tinkering with this approach, I decided that it didn’t entirely work for me to add this constructor. Some folks have approached this problem by accepting a HttpContextBase object as an optional parameter to a new constructor to a new Page subclass. The biggest things that I want to be able to unit-test in my application are the interactions with the browser: is the Page processing the postback data properly? Is the Page interacting with Querystring data correctly? These are interactions with the HttpContext object which is NOT mockable and very hard to substitute in a Page. The only Microsoft resource used to write this code was a browse through the ASP.NET Web Forms source code, which is freely available to the public at I was writing some ASP.NET Web Forms code and decided to dig further into being able to unit-test my code. This is not a project I was assigned by my employer, nor is it sponsored by my employer. ![]() ![]() I decided to do some research and start doing something about that. With my favorite web development framework, ASP.NET, its been very difficult to build unit tests for the server-side code that you write for the Web Forms UI framework. I’m a huge fan of unit testing… its my safety net, allowing me to make changes to an application without fear that I’ve broken core functionality. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |