Exemplo n.º 1
0
        public async Task add_many_PersistedGrantEntity()
        {
            _currentManyEntities = new List <PersistedGrantEntity>();

            for (int i = 0; i < 2; i++)
            {
                var clientId  = NewGuidS;
                var subjectId = NewGuidS;
                var ttl       = 60 * 60;
                for (var j = 0; j < 10; j++)
                {
                    _currentManyEntities.Add(new PersistedGrantEntity
                    {
                        Key          = NewGuidS,
                        ClientId     = clientId,
                        CreationTime = DateTime.UtcNow,
                        SubjectId    = subjectId,
                        Data         = NewGuidS,
                        Expiration   = DateTime.UtcNow.AddSeconds(ttl),
                        Type         = NewGuidS,
                        TTL          = ttl
                    });
                }
            }

            var id = NewGuidS;


            var addedResults = await _persistedGrantCosmosStore.AddRangeAsync(_currentManyEntities);

            addedResults.IsSuccess.Should().BeTrue();

            addedResults.SuccessfulEntities.Count.Should().Be(20);
        }