In the old days, I tested aspnet web forms using the Model View Presenter template. I was able to test the code using this template because I abstracted the conditional logic / loops / etc into a separate class that did not live inside the webforms framework.
What remained in the webforms codebehind code was nothing more than a few properties and a page load call to run the presenter class itself.
Then, each event handler simply passes the work on to the presenter class.
I spent a lot of time on this template and found that it makes things more convenient for testing, but this is a lot of work compared to aspnet mvc
Toran billups
source share