NSubstitute
NSubstitute copied to clipboard
Please allow to add mixins to the substitute
Right now, only CallRouter instance is added as a mixin to the substitute:
private ProxyGenerationOptions GetOptionsToMixinCallRouter(ICallRouter callRouter)
{
var options = new ProxyGenerationOptions(_allMethodsExceptCallRouterCallsHook);
options.AddMixinInstance(callRouter);
return options;
}
It will be great to be able to add more mixins that will be skipped by CastleForwardingInterceptor.
Do you have an example of a mixin you'd like to add?
- Dictionary or any other object to store data that is shared between methods. Useful for complex substitute builders.
- Partial substitute that transfers calls to interface implementation to existing instance
- Object to store settings or additional features for a specific substitute instance that can be used by extenders (overridden default values, repeatability, default initializers, etc.)