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