Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Test Driven Development with C#: Developing Real World Applications with TDD
This is the forum to discuss the Wrox book Professional Test Driven Development with C#: Developing Real World Applications with TDD by James Bender, Jeff McWherter; ISBN: 978-0-470-64320-4
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Test Driven Development with C#: Developing Real World Applications with TDD 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
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 26th, 2013, 07:05 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Chapter 7: Unit Test Only Tests the Mock?

I really appreciated chapter 7 overall, it was a nice walk-through of a simple TDD approach.

However, I'm concerned about the part that tests that an ArgumentNullException is thrown. The way it is written, this unit test is testing the mock, not the actual entity!

Maybe the example wasn't completed accidentally, but code should have been added to the ItemTypeRepository to actually throw an ArgumentNullException when called with "null".
Reply With Quote
  #2 (permalink)  
Old March 27th, 2013, 11:54 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Looking at it further this morning, I think I see where my confusion was.

I was mistakenly thinking the code was doing a setup on the ItemTypeRepository.Save method, when in fact it's on the NHibernate session.Save method.

I'm assuming this method in fact does throw an ArgumentNullException in actuality.
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

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
Chapter 7 Unit Testing with the Unit Test Framework - examples blaurence46 BOOK: Professional Application Lifecycle Management with Visual Studio 2010 1 September 24th, 2011 11:07 AM
Unit tests for agathas storefront ksouthworth BOOK: Professional ASP.NET Design Patterns 1 December 18th, 2010 01:09 PM
about unit test samvan BOOK: Professional ASP.NET Design Patterns 1 November 13th, 2010 06:32 AM
Where are all the unit tests? Extrakun BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 1 July 17th, 2007 06:39 PM



All times are GMT -4. The time now is 07:56 PM.


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