public async Task RemoveClaimFromUserWithClaim()
        {   
            var commandHandler = new RemoveUserProfileIncompleteClaimCommandHandler(Context);
            await commandHandler.Handle(new RemoveUserProfileIncompleteClaimCommand { UserId = _user1.Id});

            var matchingClaims = Context.UserClaims.Where(u => u.UserId == _user1.Id && u.ClaimType == ClaimTypes.ProfileIncomplete);
            Assert.Empty(matchingClaims);            
        }
Beispiel #2
0
        public async Task RemoveClaimFromUserWithClaim()
        {
            var commandHandler = new RemoveUserProfileIncompleteClaimCommandHandler(Context);
            await commandHandler.Handle(new RemoveUserProfileIncompleteClaimCommand { UserId = _user1.Id });

            var matchingClaims = Context.UserClaims.Where(u => u.UserId == _user1.Id && u.ClaimType == ClaimTypes.ProfileIncomplete);

            Assert.Empty(matchingClaims);
        }
        public async Task RemoveClaimFromUserWithoutClaim()
        {
            var commandHandler = new RemoveUserProfileIncompleteClaimCommandHandler(Context);
            await commandHandler.Handle(new RemoveUserProfileIncompleteClaimCommand { UserId = _user2.Id });

            var matchingClaimForUser1 = Context.UserClaims.Where(u => u.UserId == _user1.Id && u.ClaimType == ClaimTypes.ProfileIncomplete);
            Assert.Single(matchingClaimForUser1);

            var matchingClaimForUser2 = Context.UserClaims.Where(u => u.UserId == _user2.Id && u.ClaimType == "SomeOtherClaim");
            Assert.Single(matchingClaimForUser2);
        }
Beispiel #4
0
        public async Task RemoveClaimFromUserWithoutClaim()
        {
            var commandHandler = new RemoveUserProfileIncompleteClaimCommandHandler(Context);
            await commandHandler.Handle(new RemoveUserProfileIncompleteClaimCommand { UserId = _user2.Id });

            var matchingClaimForUser1 = Context.UserClaims.Where(u => u.UserId == _user1.Id && u.ClaimType == ClaimTypes.ProfileIncomplete);

            Assert.Single(matchingClaimForUser1);

            var matchingClaimForUser2 = Context.UserClaims.Where(u => u.UserId == _user2.Id && u.ClaimType == "SomeOtherClaim");

            Assert.Single(matchingClaimForUser2);
        }