Does NSubstitute support the idea of Partial Mocks?
Asked
Active
Viewed 1,417 times
3 Answers
4
Update: As @Brian points out, NSubstitute 1.7+ supports partial mocks
Original answer:
Not as of v1.0.
It is something we're considering for vNext. If you have specific syntax ideas or requirements please post to the user group. I've added an issue for this to the issue log, so you could also add details there.

David Tchepak
- 9,826
- 2
- 56
- 68
-
u may also want to change/close this answer. since it is highest voted but actually now incorrect – Simon Apr 15 '14 at 23:16
-
Done. Not sure on the etiquette for major updates to answers, so hope this is ok. – David Tchepak Apr 15 '14 at 23:31
3
Yes! This feature was introduced in version 1.7.0 (released January 2014).

Brian Hinchey
- 3,601
- 1
- 39
- 36
-3
I am using version 1.3.0.0, but I could do:
Constraint failing = Substitute.For<Constraint>();
failing.Matches(-1).Returns(false);
Where Constraint is a class with virtual methods and the method call was substituted just fine.

Daniel Gonzalez
- 9
- 3