Hi
the following code works as expected
public class className
{
public static readonly className Instance=new className();
private int i = 0;
public className()
{
}
public int I
{
get { return i; }
set { i = value; }
}
}
[TestFixture]
public class ClassName
{
[TestFixtureSetUp]
public void SetUp()
{
MockManager.Init();
}
[Test]
public void MethodName()
{
Mock all = MockManager.MockAll(typeof(className),Constructor.NotMocked);
all.ExpectGetAlways("I","2");
Assert.AreEqual("2", className.Instance.I);
all.Clear("get_I");
Assert.AreEqual("", className.Instance.I);
}
}
but when i use MS enterprise library to initialize the classname class the test method fails at the 2nd assertion
classname inittialization
public static readonly className Instance=(className)ConfigurationManager.GetConfiguration("classname");
line failure
Assert.AreEqual("", className.Instance.I);