I recall that there is a mocking framework build into nUnit, but I can find details of it on the nUnit web site. Was I dreaming?
I was considering using it to save the pain of having to introduce another assembly 开发者_JAVA百科that we will have to managed on all developer’s machines.
Are there any great dis-advantages to it as a mocking framework?
What I have found:
nUnit mock is in its own dll (nunit.mocks.dll) so it not truly built into nUnit – this removes the reason I was looking at it.
From another question:
NUnit Mocks is very quaint as far as mocking goes. It doesn't support the currently preferred Arrange-Act-Assert syntax relying instead on Expect-Verify (record/replay). It also relies on strings to identify method and property names instead of lambdas. This makes it significantly resistant to refactoring. This is a serious problem. I would not recommend it.
So I think nUnit.mock is a none-starter for new code.
It seams to use strings rather than method calls. I'd avoid like the plague, string based mocking frameworks don't handle refactoring well (and generally suck). It is also not being updated.
introduce another assembly
Throw it in the version control. :)
精彩评论