views:

364

answers:

1

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?

+1  A: 

Seems like being an old issue, I found a similar request from 2008 for the same thing. [1]

Unless someone with more experience chimes in I'd suggest poking the project guys. I found no recent request on the lists, so I guess you didn't do that yet (at least not in a public way). They should really add that to their FAQ on sf.net.

1: http://sourceforge.net/projects/nmock2/forums/forum/377147/topic/2095780

Benjamin Podszun
I've mailed one of the project guys, hopefully will hear something soon.
Igor Zevaka
Great. Please update this question so that others might find the answer in the future.
Benjamin Podszun