Beginning to Mock with Rhino Mocks and MbUnit - Part 2
page 5 of 5
by Ben Hall
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 32557/ 98

Summary

We have discussed how to isolate your business layer tests by mocking out the data access layer so it is reliable and the only test what it is supposed to. We then discussed how to actually test the data access layer, mocking out the database and web service for most of the tests, but then how we actually have to hit the database and web service in order for complete code coverage.

You can download the full code solution using the link at the top which contains all the tests, implementations and web service.  If you have any questions or comments, please feel free to contact me.

 


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 2 and 6 and type the answer here:

User Comments

Title: SE   
Name: Rakib
Date: 5/12/2010 6:29:21 AM
Comment:
Its a very good article
Title: CannotConnectToDatabaseException   
Name: Ben Hall
Date: 4/3/2008 10:12:17 AM
Comment:
CannotConnectToDatabaseException is a custom exception I created in my production code (what is being tested) because I couldn't create a SqlException to raise from that side :)
Title: Listing 5: Expect.Call GetAllBooks but call GetBooksWithPriceBelow   
Name: Bert Vanpeteghem
Date: 1/15/2008 5:13:50 AM
Comment:
A question on Listing 5:
In the record-section: there is Expect.Call(mockDataAccess.GetAllBooks())...
And in the playback-section:
bookService.GetBooksWithPriceBelow(10);

Shouldn't the call to GetBooksWithPriceBelow also be in the record?
Title: S/W Engineer   
Name: Bill Campbell
Date: 10/15/2007 12:52:47 PM
Comment:
Here's a link to the first one:

http://aspalliance.com/1400_beginning_to_mock_with_rhino_mocks_and_mbunit__part_1
Title: Beginning to Mock Part 2 Needs a Part 1 Link   
Name: Roger Jennings
Date: 10/15/2007 11:01:12 AM
Comment:
There's no obvious link to Part 1 in the introduction, which recommends it for readers unfamiliar with mock frameworks.

--rj

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2012 ASPAlliance.com  |  Page Processed at 2/13/2012 12:00:35 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search