public async Task UpdateConsentAsync(Client client, ClaimsPrincipal user, IEnumerable <string> scopes)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            if (client.AllowRememberConsent)
            {
                var subject  = user.GetSubjectId();
                var clientId = client.ClientId;

                if (scopes != null && scopes.Any())
                {
                    var consent = new Consent
                    {
                        Subject  = subject,
                        ClientId = clientId,
                        Scopes   = scopes
                    };
                    await _store.UpdateAsync(consent);
                }
                else
                {
                    await _store.RevokeAsync(subject, clientId);
                }
            }
        }
        public async Task RevokedConsentsShouldNotBeReturned()
        {
            await _setup;
            var   indexedConsents = _subjectBConsents.OrderBy(ClientIdOrdering)
                                    .Select((x, i) => new { Index = i, Consent = x }).ToArray();

            foreach (var indexedConsent in indexedConsents)
            {
                if (indexedConsent.Index % 2 == 0)
                {
                    await _store.RevokeAsync(indexedConsent.Consent.Subject, indexedConsent.Consent.ClientId);
                }
            }
            var results = await _store.LoadAllAsync(SubjectB);

            Assert.Equal(
                indexedConsents
                .Where(x => x.Index % 2 != 0)
                .Select(x => TestData.ToTestableString(x.Consent))
                .ToArray(),
                results
                .OrderBy(ClientIdOrdering)
                .Select(TestData.ToTestableString)
                .ToArray()
                );
        }