public async Task Creates_GUIDs_test(bool async)
        {
            var sequentialGuidIdentityGenerator = new GuidValueGenerator();

            var values = new HashSet<Guid>();
            for (var i = 0; i < 100; i++)
            {
                var guid = async
                    ? await sequentialGuidIdentityGenerator.NextAsync(Mock.Of<StateEntry>(), Mock.Of<IProperty>())
                    : sequentialGuidIdentityGenerator.Next(Mock.Of<StateEntry>(), Mock.Of<IProperty>());

                values.Add((Guid)guid);
            }

            Assert.Equal(100, values.Count);
        }
Esempio n. 2
0
        public async Task Creates_GUIDs_test(bool async)
        {
            var sequentialGuidIdentityGenerator = new GuidValueGenerator();

            var values = new HashSet <Guid>();

            for (var i = 0; i < 100; i++)
            {
                var guid = async
                    ? await sequentialGuidIdentityGenerator.NextAsync(Mock.Of <StateEntry>(), Mock.Of <IProperty>())
                    : sequentialGuidIdentityGenerator.Next(Mock.Of <StateEntry>(), Mock.Of <IProperty>());

                values.Add((Guid)guid);
            }

            Assert.Equal(100, values.Count);
        }