Visual Studio Nunit & Rhino Mocks Templates

15 01 2008

Click here for the updated version of this post




11 responses

22 02 2008

Hi Matteo,

I can’t seem to find the download link on your page for the file DDTemplates.vsi. Could you please provide us with one?

Thanx and cheers,


22 02 2008

Hi Mike,

I’m sorry that you can’t find it, you should see a black widget on the right sidebar. It is a flash animation or something similar so I guess that maybe you need some kind of update to see it.

Anyway, I solved the problem: I didn’t know before that is possible to access files by normal links.
Try this and let me know if it works (it should).

Hope you find it useful đŸ™‚


25 02 2008

Hi Mateo,

Thanks a lot for the link. It worked fine. I’ll install the template and give you some feedback soon,

Take care and thanx again for that great template,


11 07 2008

This looks great as I’m new to TDD and am really trying to adopt some better practice to feel more confident in my coding. It’ll probably be a little while before I really get started with this but a template like this is really helpful.

I’ve just downloaded and installed everything but I do get a couple of compile errors relating to IDependancy and Subject not being found. I’m probably missing something obvious but wondered if you could help.



11 07 2008

Hello Matt,

the method: TestMethod1() automatically generated in default test class is
only a sample method to be used as a skeleton for your actual tests.
It contains the Record-Playback syntax of Rhino Mocks.
To make it compile you should replace ‘Subject’ and ‘IDependency’ with the types you’re using in your project.
Subject is the type of the object you want to test, while IDependency is the type of the argument to pass to its constructor.
Rhino Mocks mocking framework wants us to code following the interface oriented programming principles together with inversion of control.
This means that you should provide interfaces for you classes and work with the interfaces every time you can.
Moreover your objects should not know everything about their own behavior. You will inject the behavior in the constructor, for example, passing an object (IDependency) that the ‘Subject’ class will rely on to do some work.
This is the reason why Rhino Mocks only allows us to mock interfaces (e.g.: IDependency) and expects us to pass them as arguments to the objects we’re testing (e.g.: Subject).

You can find more information on mocking in general in this wonderful article by Martin Fowler: Mocks aren’t Stubs
You can find information about Rhino Mocks here and on the author’s wiki pages: here

Hope that this helps.
I’m going to send you two sample classes to make the code compile.

23 03 2011

i can not download ur TDD template , so ,can you email it to me ? thanx

23 03 2011


I will send you as soon as possible. At the moment I’m behind a firewall at work. Remember that the templates are a bit obsolete because they refer to old versions of RhinoMocks and Nunit but they should still work if you change the references in the projects created.



30 11 2011


I am new to this.
Can u help me include NUnit in my references,
Probably I need to register a .dll somewhere in the GAC or the registry?


27 05 2013

Hi there just wanted to give you a quick heads up and let you know
a few of the images aren’t loading correctly. I’m not sure why but I think its a linking issue.
I’ve tried it in two different web browsers and both show the same results.

27 11 2015

You ought to be a part of a contest for one of the finest websites
online. I’m going to highly recommend this website!

4 01 2016
level boards ride mini segway

Hi there I am so excited I found your weblog, I really found you by accident, while I was looking on Digg for
something else, Regardless I am here now and would just like
to say many thanks for a marvelous post and a all round
thrilling blog (I also love the theme/design), I don’t have time to browse
it all at the minute but I have bookmarked it and also added your RSS feeds, so when I have time
I will be back to read more, Please do keep up the fantastic job.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: