コード例 #1
0
        public async Task GetClaimsAsync()
        {
            using (var uow = _unitOfWorkManager.Begin())
            {
                var user = await _userRepository.FindByNormalizedUserNameAsync(_lookupNormalizer.Normalize("john.nash"));

                user.ShouldNotBeNull();

                var claims = await _identityUserStore.GetClaimsAsync(user);

                claims.ShouldNotBeEmpty();
                claims.ShouldContain(x => x.Type == "TestClaimType" && x.Value == "42");

                await uow.CompleteAsync();
            }
        }