NSubstitute icon indicating copy to clipboard operation
NSubstitute copied to clipboard

Exception throwing on non implemented calls

Open raddy77 opened this issue 3 years ago • 2 comments

It would be nice to have the possibility to specify that any calls to the mock not specifically implemented will throw an exception.

I imagine this could be achieved through a parameter in the ctor of Substitute.For<T>?

This is a common feature of other mock frameworks (I know FakeItEasy has this).

Thanks for the good work!

raddy77 avatar Sep 09 '22 10:09 raddy77

Hi @raddy77 ,

There is a long history of debate around strict mocks for NSubstitute. 😂 Would you have any time free to attempt a PR for this?

dtchepak avatar Oct 15 '22 04:10 dtchepak