I am a bit confused over which version of NMock2 I should use. The one I've been using for a while I got from here:
http://www.nmock.org/download.html
The filename is NMock2.dll with version 2.0.0.44.
I ran into a problem where I couldn't mock interfaces containing generic functions. After a quick google search found out that NMock2 supports mocking interaces with generic functions.
Turns out I had to use a different NMock2 from here:
http://sourceforge.net/projects/nmock2/
This version (NMock.dll 2.1.3641.19651) does indeed support interfaces with generic functions and is mostly compatible with the other version. So far I found that there are subtle differences around Will()
function - if a function is not void
you must pass Return.Value(something)
to Will()
.
There was some light shed on the matter here:
http://codelog.blogial.com/2009/08/19/using-nmock2-in-c/#comment-4355
If you want to have a look at the latest and greatest NMock2 then please go to http://sourceforge.net/projects/nmock2. The one with the 2 in its name.
The version on the nmock site (which is not under our control, unfortunately) is not maintained anymore.
So, the question is: Is the latter NMock2 (2.1) the next version of NMock 2.0 and is it legit(in the way that it's the only nmock being supported now) and should we use that instead of the one found on nmock.org?