开发者

Differences between NMock 2.0 and NMock2

开发者 https://www.devze.com 2022-12-14 10:06 出处:网络
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:

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/us开发者_Python百科ing-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?


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


I maintain a private build of NMock, NUnit, et al. since fragmentation exists in this space. See TestMetal: A custom source build of NUnit, NMock, and OpenCover (with Castle Core) for .NET.

The current code is the latest NMock2 code (nmock2-2.1.3641.rtm), not the code on CodePlex called NMock3 (to be merged at a later date). Stable and production ready. See 'testmetal / src / TestMetal.Core / Double'...namespaces remain the same however.

https://github.com/dpbullington/testmetal

0

精彩评论

暂无评论...
验证码 换一张
取 消