Tutorial about mocking with Rhino Mocks and Moq

I was asked to write a tutorial about mocking with Rhino Mocks on DotNetSlackers.

Introduction

When using TDD to develop an application it is essential that the system under test (SUT) can be tested in isolation. That is, only the class that I am currently developing is “real” and all other parts are simulated or faked. If my SUT needs to collaborate with other components those other components are mocked during the test. We can either manually implement such mock objects or use a mocking framework for this task. There exist several well known mocking frameworks for the .NET platform. In this article I’ll give a short introduction in the two most used OSS mocking frameworks. The first is Rhino Mocks which was developed by Oren Eini, aka Ayende and the other one is Moq developed by Daniel Cazzulino.

 

The first part of this tutorial is now online and can be seen here.

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

About Gabriel Schenker

Gabriel N. Schenker started his career as a physicist. Following his passion and interest in stars and the universe he chose to write his Ph.D. thesis in astrophysics. Soon after this he dedicated all his time to his second passion, writing and architecting software. Gabriel has since been working for over 12 years as an independent consultant, trainer, and mentor mainly on the .NET platform. He is currently working as chief software architect in a mid-size US company based in Austin TX providing software and services to the pharmaceutical industry as well as to many well-known hospitals and universities throughout the US and in many other countries around the world. Gabriel is passionate about software development and tries to make the life of developers easier by providing guidelines and frameworks to reduce friction in the software development process. Gabriel is married and father of four children and during his spare time likes hiking in the mountains, cooking and reading.
This entry was posted in Mock, mocking framework, tutorial. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • http://blog.fohjin.com Mark Nijhof

    Thanks for this tutorial! I send it around to everybody in the office (well the devs)

    -Mark

  • http://top-web-tutorial.blogspot.com/ Tutorial MEn

    Thanks for tutorial, 1 exemple is more than 1000 words

  • http://www.typemock.com Avi Kaye

    an excellent tutorial, and one that’ll help anyone looking for mocking frameworks. if you want to toss in Typemock Isolator into the mix, let me know at avik at typemock dot com, and I’ll set you up with a license.

    By the way, your bio page (http://www.lostechies.com/members/gnschenker/default.aspx) is a bit garbled :)