tags:

views:

622

answers:

6

Please advise on the easiest learning path, as well as simple mocking library to start with.

+11  A: 

Try Stephen Walther's excellent article here:

http://stephenwalther.com/blog/archive/2008/03/23/tdd-introduction-to-rhino-mocks.aspx

EDIT: And I would advise that you do start with Rhino mocks as it does seem to the be the current defacto standard.

IainMH
The only thing I would say against that article is that it's quite old and so uses the record-replay syntax that I find much harder to use (and pick up) than the AAA style.
Garry Shutler
@Garry Shutler - That's a good point. Here's a link to the new style syntax: http://ayende.com/Blog/archive/2008/05/16/Rhino-Mocks--Arrange-Act-Assert-Syntax.aspx
IainMH
+1  A: 

Perhaps you should try NMock.

Nenad
+2  A: 

I would strongly recommend using Rhino Mocks. It is, in my opinion, the best and easiest to use mocking framework out there.

It has support for the Arrange-Act-Assert syntax which for me is the most logical way of setting up and using your mock objects. This article is a decent primer on how to use it.

Garry Shutler
+4  A: 

I'm actually trying to get up to speed with mocking myself, and I've found that MOQ seems to be a little more intuitive than Rhino Mocks (if you're comfortable with lamdas and are using .NET 3.5).

Phil Haack compairing MOQ with Rhino Mocks: http://haacked.com/archive/2008/03/23/comparing-moq-to-rhino-mocks.aspx

Quick Start page on Google Code: http://code.google.com/p/moq/wiki/QuickStart

Ben Anderson
+1 for Moq, especially if you are familiar with or want to become more familiar with lambdas.
flipdoubt
I think Moq is generally a diversion before you have to suck it up and move on to Rhino mocks anyway.
IainMH
A: 
string mockingStatement = "You've got a face like a bulldog licking p!ss off a nettle!";
Response.Write(mockingStatement);
Sheff
+1, except it won't compile!mockingStatemnet, undeclared identifier ;)
Adam Naylor
+2  A: 
string
  mocking_statement = "Your mother is an hamster and your father smells of elderberries!";

Response.Write (mocking_statement);

Skizz

Skizz
Ah, it's a sorry state of affairs when programmers don't recognise Monty Python quotes. :-(
Skizz
@Skizz I voted you +1, because I think it's a shame that some people on here have seemingly zero sense of humour.
IainMH
Sense of humor varies greatly among cultures, so please take it into account. What can be funny for a russian can be severly offensive to an american, and vice verca.
Valentin Vasiliev
I think that one must accept that there will be cultural misunderstandings when using this site. I didn't check your nationality before posting, so you might not have known of alternate forms of the verb 'to mock'. I find the name of the SCC 'git' offensively amusing, it's an abusive term in UK.
Skizz