You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Question
If you create a Substitute for a type via Substitute.For<MyType>(), you can detect if the instance is a substitute by checking if myInstance is ICallRouterProvider (as per #659).
However, what I have been unable to figure out is how to tell whether a method/property has been configured (ie via Returns(), Do(), etc). With Moq you could do this via searching the Setups collection, but there does not seem to be any equivalent here.
If there's no public API available to access this information, I don't mind having to utilise reflection to achieve this, however I'm not very familiar with NSubstitute, and my initial investigative efforts have only led me so far (ie that I may potentially be looking to try and access CallActions from somewhere, however I could be mistaken).
The text was updated successfully, but these errors were encountered:
Question
If you create a Substitute for a type via
Substitute.For<MyType>()
, you can detect if the instance is a substitute by checking ifmyInstance is ICallRouterProvider
(as per #659).However, what I have been unable to figure out is how to tell whether a method/property has been configured (ie via
Returns()
,Do()
, etc). With Moq you could do this via searching theSetups
collection, but there does not seem to be any equivalent here.If there's no public API available to access this information, I don't mind having to utilise reflection to achieve this, however I'm not very familiar with NSubstitute, and my initial investigative efforts have only led me so far (ie that I may potentially be looking to try and access
CallActions
from somewhere, however I could be mistaken).The text was updated successfully, but these errors were encountered: