NSubstitute icon indicating copy to clipboard operation
NSubstitute copied to clipboard

Please allow to add mixins to the substitute

Open AlexanderSher opened this issue 11 years ago • 2 comments

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.

AlexanderSher avatar Sep 29 '14 04:09 AlexanderSher

Do you have an example of a mixin you'd like to add?

dtchepak avatar Sep 29 '14 04:09 dtchepak

  1. Dictionary or any other object to store data that is shared between methods. Useful for complex substitute builders.
  2. Partial substitute that transfers calls to interface implementation to existing instance
  3. 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.)

AlexanderSher avatar Sep 29 '14 05:09 AlexanderSher