public void Returns_A_Unique_Identifier_Even_When_An_Instance_Is_Released_But_Reuse_Is_False() { var generator = new IntegerObjectIdGenerator <PersonViewModel2>(); var uniqueIdentifierForInstance = generator.GetUniqueIdentifierForInstance(new PersonViewModel2()); GC.Collect(); GC.WaitForPendingFinalizers(); Assert.AreNotEqual(uniqueIdentifierForInstance, generator.GetUniqueIdentifierForInstance(new PersonViewModel2())); }
public void Returns_A_Released_Identifier_If_The_Instance_Is_Released_And_Reuse_Is_True() { var generator = new IntegerObjectIdGenerator <PersonViewModel1>(); var uniqueIdentifierForInstance = generator.GetUniqueIdentifierForInstance(new PersonViewModel1()); GC.Collect(); GC.WaitForPendingFinalizers(); Assert.AreEqual(uniqueIdentifierForInstance, generator.GetUniqueIdentifierForInstance(new PersonViewModel1(), true)); }
public void Returns_A_Unique_Identifier_For_Different_Instances() { var generator = new IntegerObjectIdGenerator <PersonViewModel3>(); Assert.AreNotEqual(generator.GetUniqueIdentifierForInstance(new PersonViewModel3()), generator.GetUniqueIdentifierForInstance(new PersonViewModel3())); }