public void SingletonInstanceValuesMatchTest() { SingletonClass singleton1 = SingletonClass.GetInstance(); SingletonClass singleton2 = SingletonClass.GetInstance(); Assert.AreEqual(singleton1.GetValue(), singleton2.GetValue()); }
public void SingletonInstanceMatchTest() { SingletonClass singleton1 = SingletonClass.GetInstance(); SingletonClass singleton2 = SingletonClass.GetInstance(); Assert.AreSame(singleton1, singleton2); }
public void CreateTwoInstances_SameInstanceReturnedInBothCalls() { var firstInstance = SingletonClass.GetInstance(); var secondInstance = SingletonClass.GetInstance(); Assert.Same(firstInstance, secondInstance); }
static void Main(string[] args) { // first with property initialization SingletonClass.GetInstance(); // second with already initialized value SingletonClass.GetInstance(); }
public void SingletonCreateTest() { SingletonClass singleton = SingletonClass.GetInstance(); Assert.IsInstanceOfType(singleton, typeof(SingletonClass)); }
public void CreateInstance() { SingletonClass instance = SingletonClass.GetInstance(); Assert.NotNull(instance); }