How to write test in Nunit to test that only one instance is created by my singleton class.
+5
A:
var first = MySingleton.Instance;
var second = MySingleton.Instance;
Assert.AreSame(first, second);
Randolpho
2010-03-28 19:50:22
Thanks Randolpho.It helped me a lot.
2010-03-28 20:07:05
+1
A:
Create the object twice and use Assert to make sure they have the same reference
Dror Helper
2010-03-28 19:50:29