none
Access private methods of a class with private constructor using fakes RRS feed

  • Question

  • Hi,

    I am using the below code to access private methods of a class when using Microsoft fakes for unit testing:-

    ClassUsed abc = new ClassUsed();
    var privateObj = new PrivateObject(abc);

    Issue am facing now with one of the classes is, it's constructor is private, therefore am not able to create an object of that class, Is there anyway I can instantiate that class ?

    Thanks in advance


    • Edited by scrutinity Monday, May 6, 2013 1:43 PM title edit
    Monday, May 6, 2013 1:40 PM

Answers

All replies