MOQ: Throwing the exception that was passed to the method
I have a method on the interface:
void HandleError(MyClasss c, object o, Exception e);
I want to mock this with MOQ and any options throwing the supplied Exception e.
Something like:
_mock.Setup(a => a.HandlreError(It.IsAny<MyClass>(), It.IsAny<object>()
, It.IsAny<Exception>())).Throws( [the 'any' exception] )
+3
source to share