scottnelsonsmith
12-16-2005, 01:41 AM
When I look at the code in the aspx.cs code-behinds, I marvel at how much logic has successfully been moved into other, more testable, classes in SpringAir.core. Congratulations!!! :D
However, in the SpringAir code-behinds, I find some code in regions marked Controller Methods (most notably in TripForm.aspx.cs).
My question is: why isn't this controller code moved into a simple class outside of the code behind where it can be tested? I can think of the following reasons:
:arrow: It is no problem to test these controller methods in the code-behind directly. Simply directly create an instance of the code behind class using the empty constructor in your unit test and test away!. :arrow: The author ran out of time and didn't place the code in separate controller classes. :arrow: The author didn't think the code was complex enough to warrant unit testing.
So, I tried the first alternative above and it worked fine.
Still, does anyone have any ideas on why the mothods in region controller are not moved to another class? Thanks in advance!
Scott
However, in the SpringAir code-behinds, I find some code in regions marked Controller Methods (most notably in TripForm.aspx.cs).
My question is: why isn't this controller code moved into a simple class outside of the code behind where it can be tested? I can think of the following reasons:
:arrow: It is no problem to test these controller methods in the code-behind directly. Simply directly create an instance of the code behind class using the empty constructor in your unit test and test away!. :arrow: The author ran out of time and didn't place the code in separate controller classes. :arrow: The author didn't think the code was complex enough to warrant unit testing.
So, I tried the first alternative above and it worked fine.
Still, does anyone have any ideas on why the mothods in region controller are not moved to another class? Thanks in advance!
Scott