how to setup the unit test if the constructor is private (.NET)?
public class Class2 {
private Class2() //private constructor
{
}
public static Class2 getInstance()
{
if (x == null)
x= new Class2();
return x;
}
}
namespace TestUnit
{
[TestFixture]
public class Class2Tester
{
private Class2 test;
[SetUp()]
public void SetUp(){
test = new Class2(); // i cant do this. how shld i setup this.
}