Los Techies : Blogs about software and anything tech!

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.

Kick It on DotNetKicks.com
Posted Apr 21 2009, 01:01 PM by Gabriel N. Schenker

Comments

Mark Nijhof wrote re: Tutorial about mocking with Rhino Mocks and Moq
on 04-21-2009 7:02 AM

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

-Mark

Summary 20.04.2009 « Bogdan Brinzarea’s blog wrote Summary 20.04.2009 « Bogdan Brinzarea’s blog
on 04-21-2009 8:51 AM

Pingback from  Summary 20.04.2009 «  Bogdan Brinzarea’s blog

Tutorial MEn wrote re: Tutorial about mocking with Rhino Mocks and Moq
on 04-21-2009 1:18 PM

Thanks for tutorial, 1 exemple is more than 1000 words

Avi Kaye wrote re: Tutorial about mocking with Rhino Mocks and Moq
on 05-24-2009 4:16 AM

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 (www.lostechies.com/.../default.aspx)  is a bit garbled :)

Add a Comment

(required)  
(optional)
(required)  
Remember Me?

Enter the numbers above:
Copyright Los Techies 2008, 2009. All rights reserved.
Powered by Community Server (Commercial Edition), by Telligent Systems