 |
|
2nd July 2008, 13:53
|
#1
|
|
Lurker not a fighter
Join Date: Dec 2007
Posts: 66
|
Unit testing ASP.NET
I am just interested in how people approach this and what they've seen in use at various client sites lately.
Being limited to ASP.NET 2.0 and MS products, my approach has been to make use of Model View Presenter and testing the presenters using mocks. I thought that might be a pretty standard approach, but the interviews I recently attended suggested otherwise (where the approach has been generally manual).
|
|
|
2nd July 2008, 13:56
|
#2
|
|
Contractor Among Contractors
Join Date: Jun 2008
Posts: 1,069
|
Quote:
Originally Posted by Jaws
I am just interested in how people approach this and what they've seen in use at various client sites lately.
|
Nunit is used quite a lot.
|
|
|
2nd July 2008, 14:01
|
#3
|
|
Moderator
Join Date: Jul 2005
Posts: 518
|
MbUnit and WatIn together will do it pretty well.
|
|
|
2nd July 2008, 14:35
|
#4
|
|
Godlike
Join Date: Jul 2005
Posts: 9,141
|
A combination of NUnit for non UI code (business, data) and Selenium for your ultra thin ASP.NET pages is what I recommend.
http://www.peterkrantz.com/2005/selenium-for-aspnet/
http://selenium-core.openqa.org/
However, most ASP.NET sites are actually tested by the users. Users are cheap and don't impact the coding phase. 
__________________
"When a true genius appears in the world, you may know him by this sign, that the dunces are all in confederacy against him." Jonathan Swift
|
|
|
2nd July 2008, 15:23
|
#5
|
|
More time posting than coding
Join Date: Aug 2006
Location: South England
Posts: 318
|
Tend to side with manual testing at the moment, but with the new MVC extensions for .Net just round the corner, hopefully VS2008's testing tools will provide more coverage.
Or rather, I should rephrase my statement to say, I tend to unit test upto the class level, as there's no VS2008 way of testing the UI at the mo. Hence, manual testing of the UI as such
Last edited by Weltchy : 3rd July 2008 at 07:09.
|
|
|
2nd July 2008, 16:52
|
#6
|
|
Lurker not a fighter
Join Date: Jun 2007
Location: Lee on the Solent, Hants
Posts: 96
|
We tend to use the testing within Visual Studio 2008 and the Assert Class, and creating a testing project. Pretty good at the class level but as mentioned previously NUNIT seems to be pretty standard practice for unit testing outside of this
|
|
|
2nd July 2008, 18:32
|
#7
|
|
Fingers like lightning
Join Date: Feb 2007
Location: Homeless
Posts: 849
|
At the risk of straying off topic, I was trying out the Web Client Software Factory for VS 2008 the other day and it creates all these test projects and mocks, etc. “What the frack is all that about?!”, thinks I, scratching my hairy arse.
Has anyone made use of all this stuff? I too am interested in automated testing as well as the MVP pattern.
It looks like what I need for a new product/service I have in mind. I’m not as techie as I once was so it’s all become a struggle to keep up with all this.
I’m going to need to use the web services stuff to get to my main database, but that will come next.
|
|
|
2nd July 2008, 20:53
|
#8
|
|
Lurker not a fighter
Join Date: Dec 2007
Posts: 66
|
Quote:
Originally Posted by HairyArsedBloke
At the risk of straying off topic, I was trying out the Web Client Software Factory for VS 2008 the other day and it creates all these test projects and mocks, etc. “What the frack is all that about?!”, thinks I, scratching my hairy arse.
Has anyone made use of all this stuff? I too am interested in automated testing as well as the MVP pattern.
It looks like what I need for a new product/service I have in mind. I’m not as techie as I once was so it’s all become a struggle to keep up with all this.
I’m going to need to use the web services stuff to get to my main database, but that will come next.
|
I did take a look at that but didn't really like the way everything was structured so opted against using it (more out of personal preference than anything else). I've used MVP in a very similar way to how they use it there, but using MS Unity for dependency injection rather than Object Builder. It's working very well for me. The general approach to the WCSF seems good though, MVP with a controller for UI logic is probably how I'd approach it for a more complex site. If you're willing to adopt technology early, as mentioned earlier, the MVC framework might be a better option (at least for your CV)!
|
|
|
10th July 2008, 19:42
|
#9
|
|
Should try harder
Join Date: Jul 2008
Posts: 120
|
I've had a brief glimpse at the software factory ui stuff, To be honest the amount of code generation scared me. for production code...but thats just me...Also started looking at the Unity block recently for DI (my first look at this pattern), looks pretty good.
I would be interested to know if there is any uptake for these factories though...I've previously hand crafted(or should i say hacked?!) everything and used the Ent Lib for my crosscutting functionality.
Apart from unit testing what other gains do you get from MVP? I might be stupid but it appears to me that if your manually testing then the page behind model gives you a useable MVP model (if rather crude).
|
|
|
16th July 2008, 21:11
|
#10
|
|
Lurker not a fighter
Join Date: Dec 2007
Posts: 66
|
Quote:
Originally Posted by LittlestHobbo
Apart from unit testing what other gains do you get from MVP? I might be stupid but it appears to me that if your manually testing then the page behind model gives you a useable MVP model (if rather crude).
|
I suppose you could theoretically use MVP to swap in alternative interfaces (winforms for instance) - although in practice that is unlikely to be a requirement. The main gain is in unit testing the code in your event handlers - that's the only reason I've ever used it.
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 09:54.
|  |
| Advertisers |
|
| Contractor Alliance |
Formed a new Ltd Co?
20% off business insurance
£10 off Bauer & Cottrell contract reviews
Find co-workers & client introductions
Increase your value to clients here
|
|