예제 #1
0
            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));
            }
예제 #2
0
            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());
            }
예제 #3
0
            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());
            }