public void IsSingleton_NotSingletonObject_ReturnsFalse() { SingletonTester .IsSingleton(() => new object()) .Should() .BeFalse(); }
public void IsSingleton_PassASingleton_ReturnsTrue() { var isSingleton = SingletonTester.IsSingleton( SingletonTesterData.GetSingletonObject); Assert.That(isSingleton, Is.EqualTo(true)); }
public void IsSingleton_SingletonObject_ReturnsTrue() { SingletonTester .IsSingleton(() => SafeSingleton.Instance) .Should() .BeTrue(); }
public void IsSingleton_PassANonSingleton_ReturnsFalse() { var isSingleton = SingletonTester.IsSingleton( SingletonTesterData.GetNonSingletonObject); Assert.That(isSingleton, Is.EqualTo(false)); }
public void Test() { var obj = new object(); Assert.IsTrue(SingletonTester.IsSingleton(() => obj)); Assert.IsFalse(SingletonTester.IsSingleton(() => new object())); }
public void IsSingletonTest() { // Arrange // Act var actual = SingletonTester.IsSingleton(() => SingletonDatabase.Instance); // Assert Assert.IsTrue(actual); }
static void Main(string[] args) { Console.WriteLine(SingletonTester.IsSingleton(CreateNonSingletonPerson)); Console.WriteLine(SingletonTester.IsSingleton(CreateSingletonPerson)); }
static void Main(string[] args) { Console.WriteLine(SingletonTester.IsSingleton(() => { return(new List <string>()); })); }