Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 4 and Visual Studio 2010 > BOOK: Professional Application Lifecycle Management with Visual Studio 2010
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Application Lifecycle Management with Visual Studio 2010
This is the forum to discuss the Wrox book Professional Application Lifecycle Management with Visual Studio 2010 by Mickey Gousset, Brian Keller, Ajoy Krishnamoorthy, Martin Woodward; ISBN: 9780470484265
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Application Lifecycle Management with Visual Studio 2010 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 29th, 2010, 03:26 PM
Registered User
 
Join Date: Jul 2010
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 7: Unit Testing with the Unit Testing Framework

Hello,

This was a great chapter with some really good info. However, I didn't see anything on how to deal with outside services or data access. I did a few searches for an MS mock object implementation and didn't find one.

Using this framework is there any way to mock data access api's? If not, are there other solutions for this?

Thanks!
Michael
  #2 (permalink)  
Old July 30th, 2010, 08:04 PM
Wrox Author
Points: 27, Level: 1
Points: 27, Level: 1 Points: 27, Level: 1 Points: 27, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2010
Location: Northern Ireland
Posts: 4
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Visual Studio doesn't come with a mocking framework I'm afraid. Best to stick with one of the popular open source or commercial mocking frameworks available at this time.

Another approach is to use the data driven tests and then either call pointing to this data or replace your data access layer (coded to a common interface) with one that reads test data shipping along with your tests - however I suspect that you tried that approach already.
The Following User Says Thank You to martinwoodward For This Useful Post:
antwarpes (August 3rd, 2010)
  #3 (permalink)  
Old August 3rd, 2010, 10:43 AM
Registered User
 
Join Date: Jul 2010
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Martin,

Thanks for the quick reply. I've actually been looking at a new framework being developed by the RiSE group at Microsoft Research. They've developed a stubbing framework called Moles that can be downloaded with the Pex & Moles VS 2010 Powertools.

http://research.microsoft.com/en-us/projects/pex/

Quote:
Moles supports unit testing by providing isolation by way of detours and stubs. The Moles framework is provided with Pex, or can be installed by itself as a Microsoft Visual Studio add-in.
Hopefully this will help anyone looking into a MS framework for stubbing (but not mocking).

Thanks,
Michael
  #4 (permalink)  
Old September 25th, 2011, 08:47 AM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2011
Location: Minneapolis, Minnesota, USA
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Moles and Mocking frameworks

I have used Moles and it is very powerful but somewhat awkward to use.
So I second Martin's recommendation that you find an open source mocking framework for your ordinary needs. Then use Moles in cases where that does not suffice. I use the MOQ framework and have been reasonably happy. Some of my colleagues like Rhino Mocks. And there are many more.

The reason I call Moles "powerful" is that it enables you to detour any .NET method, including non-virtual/static methods in sealed types. I am not aware of any free, open-source mocking products that can do this. It is a capability normally found only in commercial mocking products like TypeMock.
 


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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unit Testing jeffmorris BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 7 May 14th, 2007 06:51 AM
Unit Testing userrob BOOK: ASP.NET Website Programming Problem-Design-Solution 2 November 9th, 2005 09:35 AM
Unit Testing XSLT N.Todd XSLT 2 March 1st, 2005 07:31 PM



All times are GMT -4. The time now is 10:47 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.