Or you can grant Rhino Mocks private access to your assembly.

On 25 June 2013 16:09, Stephen Bohlen <[email protected]> wrote:

>  Declare the ctor protected instead of private.
>
> This is usually a better design choice anyway because you can't predict
> the future well enough to know that nobody will ever want/need to override
> the ctor in a derived class :)
>
> -Steve B.
>  ------------------------------
> From: Shaleen Pandiya <[email protected]>
> Sent: 6/25/2013 10:25 AM
> To: [email protected]
> Subject: [RhinoMocks] How to Mock a class which has private Constructor
>
> Hi
>
> i have a class "Configuration.cs" which has a private constructor (i did
> it for the Singleton implementation).
> Now i want to mock this class (Partial Mock) but i am not able to do it.
> Error:
>
> Can not instantiate proxy of class:
> Efi.CrmIntegration.MonarchServices.Utilities.Configuration.
> Could not find a parameterless constructor.
> Parameter name: constructorArguments
>
> Whats the solution for the same.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/rhinomocks.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/rhinomocks.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rhinomocks.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to