public void SingletonSealedDisposableClass_OneInstance_AreSame() { // Assamble SingletonSealedDisposableClass first = SingletonSealedDisposableClass.Instance; SingletonSealedDisposableClass second = SingletonSealedDisposableClass.Instance; // Act // Assert Assert.AreSame(first, second); }
public void SingletonSealedDisposableClass_OneInstance_AreEqual() { // Assamble SingletonSealedDisposableClass first = SingletonSealedDisposableClass.Instance; SingletonSealedDisposableClass second = SingletonSealedDisposableClass.Instance; // Act first.SomeValue++; // Assert Assert.AreEqual(first.SomeValue, second.SomeValue); // Act second.SomeValue++; // Assert Assert.AreEqual(first.SomeValue, second.SomeValue); // They should be always same Assert.AreSame(first, second); }