9

I used to have a very convenient spying framework in java called Mockito. It allows you to mock some of methods on existing objects and also could tell you if others were called (you'd create a spy wrapper for that). Is there anything like that for C# in .NET 3.x?

Artem
  • 7,275
  • 15
  • 57
  • 97

2 Answers2

12

It sounds like you are describing "partial mocks". Some (most?) mocking frameworks have support for that. I know for sure Moq and RhinoMocks do.

Msp
  • 2,493
  • 2
  • 20
  • 34
Dylan Smith
  • 22,069
  • 2
  • 47
  • 62
  • Thank you! Unfortunately the one we use doesn't do this https://github.com/nsubstitute/NSubstitute/issues/41 but Moq look like a great alternative – Artem Apr 02 '13 at 19:39
3

They are out there, but they cost money.

You could try JustMock or TypeMock

Jeff Vanzella
  • 737
  • 5
  • 14