Contractor UK Bulletin Board  PayStream

Go Back   Contractor UK Bulletin Board > Contractor UK Forums > Technical
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 2nd July 2008, 13:53   #1
Jaws
Should try harder
 
Join Date: Dec 2007
Posts: 102
Default 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).
Jaws is offline   Reply With Quote
Old 2nd July 2008, 13:56   #2
TheBigYinJames
Contractor Among Contractors
 
TheBigYinJames's Avatar
 
Join Date: Jun 2008
Posts: 1,437
Default

Quote:
Originally Posted by Jaws View Post
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.
TheBigYinJames is offline   Reply With Quote
Old 2nd July 2008, 14:01   #3
scotspine
Moderator
 
scotspine's Avatar
 
Join Date: Jul 2005
Posts: 531
Default

MbUnit and WatIn together will do it pretty well.
scotspine is offline   Reply With Quote
Old 2nd July 2008, 14:35   #4
DimPrawn
Godlike
 
DimPrawn's Avatar
 
Join Date: Jul 2005
Posts: 10,425
Default

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.
__________________
Last week I cashed a cheque and the bank bounced.
DimPrawn is offline   Reply With Quote
Old 2nd July 2008, 15:23   #5
Weltchy
More time posting than coding
 
Join Date: Aug 2006
Location: South England
Posts: 332
Send a message via MSN to Weltchy
Default

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.
Weltchy is offline   Reply With Quote
Old 2nd July 2008, 16:52   #6
Solent
Should try harder
 
Join Date: Jun 2007
Location: Lee on the Solent, Hants
Posts: 125
Default

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
Solent is offline   Reply With Quote
Old 2nd July 2008, 18:32   #7
HairyArsedBloke
Contractor Among Contractors
 
HairyArsedBloke's Avatar
 
Join Date: Feb 2007
Location: Homeless
Posts: 1,720
Default

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.
HairyArsedBloke is offline   Reply With Quote
Old 2nd July 2008, 20:53   #8
Jaws
Should try harder
 
Join Date: Dec 2007
Posts: 102
Default

Quote:
Originally Posted by HairyArsedBloke View Post
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)!
Jaws is offline   Reply With Quote
Old 10th July 2008, 19:42   #9
LittlestHobbo
Should try harder
 
Join Date: Jul 2008
Posts: 134
Default

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).
LittlestHobbo is offline   Reply With Quote
Old 16th July 2008, 21:11   #10
Jaws
Should try harder
 
Join Date: Dec 2007
Posts: 102
Default

Quote:
Originally Posted by LittlestHobbo View Post
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.
Jaws is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT. The time now is 07:21.


Advertisers
PayStream

CUK Navigation

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

Fast Company Formation
Same day online company formation £75 + VAT

Form your Ltd Co Here

Contractor Services


 
Content Relevant URLs by vBSEO 2.4.0 © 2005, Crawlability, Inc.