Multiple mocks, asserts, and hidden results

Posted by: ISerializable, on 09 Feb 2011 | View original | Bookmarked: 0 time(s)

In his post one mock per test considered harmful , Phillip suggests that having multiple mocks used could make a more readable specification.  he also disagrees with the way I provide some of the advice in my book. First, Id like to get to the technical issue at the heart of this matter. Why do I not want to test more than one thing in the test? because mock verifications, much like asserts, throw exceptions. That means that any verifications below that line never get called and so youll never...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: Agile | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 483 | Hits: 9

Similar Posts

  • Design for a Mock JDBC Driver more
  • Linq to Mocks is finally born more
  • A Gentle Introduction to Mocking more
  • Test Specific Subclasses vs Partial Mocks more
  • Test Secure Class Instantiation Helper Method more
  • Rhino Mocks + Extension Methods + MVC == Crazy Delicious more
  • Generic constraint for Rhino Mocks - make unit tests more readable more
  • Unit Testing Security Example more
  • Design for a Mock JDBC Driver more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD