Esempio n. 1
0
        public void HadRequiredClaim_OwnedClaimsMissingARequiredClaim_IsFalse()
        {
            var requiredClaims = new AuthorizationClaim[]
            {
                AuthorizationClaim.ModerationRead,
                AuthorizationClaim.ModerationWarn
            };

            var ownedClaims = new AuthorizationClaim[]
            {
                AuthorizationClaim.ModerationWarn
            };

            var authResult = new AuthResult(requiredClaims, ownedClaims);

            authResult.HadRequiredClaim(AuthorizationClaim.ModerationRead).ShouldBeFalse();
        }
Esempio n. 2
0
        public void HadRequiredClaim_CheckedClaimWasNotRequired_IsFalse()
        {
            var requiredClaims = new AuthorizationClaim[]
            {
                AuthorizationClaim.ModerationRead,
                AuthorizationClaim.ModerationWarn
            };

            var ownedClaims = new AuthorizationClaim[]
            {
                AuthorizationClaim.ModerationWarn
            };

            var authResult = new AuthResult(requiredClaims, ownedClaims);

            authResult.HadRequiredClaim(AuthorizationClaim.PostInviteLink).ShouldBeFalse();
        }
Esempio n. 3
0
        public void HadRequiredClaim_OwnedClaimsContainsARequiredClaim_IsTrue()
        {
            var requiredClaims = new AuthorizationClaim[]
            {
                AuthorizationClaim.ModerationRead,
                AuthorizationClaim.ModerationWarn
            };

            var ownedClaims = new AuthorizationClaim[]
            {
                AuthorizationClaim.ModerationRead,
                AuthorizationClaim.ModerationWarn
            };

            var authResult = new AuthResult(requiredClaims, ownedClaims);

            authResult.HadRequiredClaim(AuthorizationClaim.ModerationRead).ShouldBeTrue();
        }