public void Returns_A_Released_Identifier_If_Requested() { IObjectIdGenerator <long> generator = new LongObjectIdGenerator <PersonViewModel2>(); var uniqueIdentifier = generator.GetUniqueIdentifier(); generator.ReleaseIdentifier(uniqueIdentifier); Assert.AreEqual(uniqueIdentifier, generator.GetUniqueIdentifier(true)); }
public void Returns_Unique_Identifier_For_DifferentTypes() { IObjectIdGenerator <long> generator1 = new LongObjectIdGenerator <PersonViewModel3>(); IObjectIdGenerator <long> generator2 = new LongObjectIdGenerator <PersonViewModel4>(); Assert.AreEqual(generator1.GetUniqueIdentifier(), generator2.GetUniqueIdentifier()); }
public void Returns_New_UniqueIdentifier_Even_If_Are_Generated_By_Different_Instances() { IObjectIdGenerator <long> generator1 = new LongObjectIdGenerator <PersonViewModel1>(); IObjectIdGenerator <long> generator2 = new LongObjectIdGenerator <PersonViewModel1>(); Assert.AreNotEqual(generator1.GetUniqueIdentifier(), generator2.GetUniqueIdentifier()); }