NMock2 Release with MockStyle.Stub?

We got the following geek question from Henrik:


Thanks for sharing this preview of the MockStyle.Stub feature!
Its exactly was I was looking for when I googled this page,
so now I just can't wait for a release with this included ;-)

I tried to find some information on futre release plans but could not find any.
Could anybody help me out? When could we3 expect a new NUnit
supporting MockStyle.Stub?



The answer to this question is a bit complicated. Let me tell you why:

The current development team of NMock2 (Thomas, Peter and me) will not actively continue to develop NMock2. We’ll still provide basic support (bug fixes) but no new features. However, we have planned to make one last release (including the Stub feature) when we are sure that it works in our projects. This will be soon because we didn’t have a new defect in the last two months or so.

The reason why we have lost interest is that Moq has gained a lot of momentum and has a much broader community support. Furthermore, Moq provides some basic improvements that we cannot simply add to NMock2: besides the type safe, refactoring friendlier syntax, it allows very clean AAA (Arrange, Act, Assert) unit tests.

On the other side, there exists the NMock3 project on CodePlex that adds a type-safe syntax wrapper around NMock2. Check it out, when you already use NMock2 in your project.

So for short: the release including the Stub feature will be available soon, but it will also be the last release.

If you can’t wait until the official release then get the code from the subversion repository and start the build.release.cmd, et voila!

Happy mocking (whatever framework you use)


About the author

Urs Enzler


  • Thank you Urs for the update!

    Makes me think I should start looking at Moq instead. Also, lately I’m also starting to get some doubts about using open source libraries for commersial projects 🙁 Things are shifting pretty quickly and quite a few of the open source tools I looked at a year ago is no longer being maintained…Maybe companies looking for 5-10 years of support need to be looking at other solutions?

    Too bad, but I guess it is what it is. Anyway its great that you guys take the time to move out knowledge/experience forward by working on stuff like this. Thank you! I appreciate it!

  • @Henrik
    Moq is surely worth a try.

    As far as open source projects are concerned, lacking support (espacially in the long term) is a problem. The open source community is a very quickly changing place. Therefore, I see two possible paths you can take:

    Path 1: look for commercial products providing support and hope that the support is helpful and that the company will still be alive in 5 years.

    Path 2: join the fast (open source) lane and prepare your software that changing a tool is possible without too much pain. Another advantage is that you can change the tool yourself as a last option.

    There are times we decide for path 1, sometimes we go for path 2.

    But I think that the .NET community is not really an open source community. That’s because everytime Microsoft releases a tool, almost everyone jumps to it (for good or bad), leaving all the probably good open source tools rotting. I’m already looking forward to the release of Pex and Moles and their impact on the mocking world 🙂

By Urs Enzler

Recent Posts