public void ReplaceClaim_NoExistingClaim_Ignores()
        {
            // note: per EF implemention - only existing claims are updated by looping through them so that impl ignores too
            var user     = new IdentityUser();
            var newClaim = new Claim("newType", "newValue");

            user.ReplaceClaim(newClaim, newClaim);

            Expect(user.Claims, Is.Empty);
        }
        public void ReplaceClaim_TypeMatchesButValueDoesNot_DoesNotReplace()
        {
            var user       = new IdentityUser();
            var firstClaim = new Claim("sameType", "value");

            user.AddClaim(firstClaim);
            var newClaim = new Claim("sameType", "newValue");

            user.ReplaceClaim(new Claim("sameType", "wrongValue"), newClaim);

            user.ExpectOnlyHasThisClaim(firstClaim);
        }
        public void ReplaceClaim_ExistingClaim_Replaces()
        {
            var user       = new IdentityUser();
            var firstClaim = new Claim("type", "value");

            user.AddClaim(firstClaim);
            var newClaim = new Claim("newType", "newValue");

            user.ReplaceClaim(firstClaim, newClaim);

            user.ExpectOnlyHasThisClaim(newClaim);
        }