コード例 #1
0
        public virtual void AugmentEntity(ValidateEntityData registrationData)
        {
            if (!TestAugmentation)
            {
                return;
            }

            UnitTestsHelper.TestAugmentationOperation(UnitTestsHelper.SPTrust.IdentityClaimTypeInformation.MappedClaimType, registrationData.ClaimValue, registrationData.IsMemberOfTrustedGroup);
        }
コード例 #2
0
 public void TestAlternativeAugmentation(ValidateEntityData registrationData)
 {
     foreach (LDAPConnection ldapConn in Config.LDAPConnectionsProp)
     {
         ldapConn.GetGroupMembershipAsADDomainProp = !ldapConn.GetGroupMembershipAsADDomainProp;
     }
     Config.Update();
     UnitTestsHelper.TestAugmentationOperation(UnitTestsHelper.SPTrust.IdentityClaimTypeInformation.MappedClaimType, registrationData.ClaimValue, registrationData.IsMemberOfTrustedGroup);
 }
コード例 #3
0
        public virtual void ValidateClaim(ValidateEntityData registrationData)
        {
            if (!TestValidation)
            {
                return;
            }

            SPClaim inputClaim = new SPClaim(UnitTestsHelper.SPTrust.IdentityClaimTypeInformation.MappedClaimType, registrationData.ClaimValue, ClaimValueTypes.String, SPOriginalIssuers.Format(SPOriginalIssuerType.TrustedProvider, UnitTestsHelper.SPTrust.Name));

            UnitTestsHelper.TestValidationOperation(inputClaim, registrationData.ShouldValidate, registrationData.ClaimValue);
        }
コード例 #4
0
    public static IEnumerable <TestCaseData> GetTestData()
    {
        DataTable dt = DataTable.New.ReadCsv(UnitTestsHelper.DataFile_AllAccounts_Validate);

        foreach (Row row in dt.Rows)
        {
            var registrationData = new ValidateEntityData();
            registrationData.ClaimValue             = row["ClaimValue"];
            registrationData.ShouldValidate         = Convert.ToBoolean(row["ShouldValidate"]);
            registrationData.IsMemberOfTrustedGroup = Convert.ToBoolean(row["IsMemberOfTrustedGroup"]);
            yield return(new TestCaseData(new object[] { registrationData }));
        }
    }
コード例 #5
0
        //[Repeat(UnitTestsHelper.TestRepeatCount)]
        public void RequireExactMatchDuringSearch(ValidateEntityData registrationData)
        {
            Config.FilterExactMatchOnly = true;
            Config.Update();

            try
            {
                int expectedCount = registrationData.ShouldValidate ? 1 : 0;
                UnitTestsHelper.TestSearchOperation(registrationData.ClaimValue, expectedCount, registrationData.ClaimValue);
            }
            finally
            {
                Config.FilterExactMatchOnly = false;
                Config.Update();
            }
        }
コード例 #6
0
    public static IEnumerable <TestCaseData> GetTestData(EntityDataSourceType entityDataSourceType)
    {
        string csvPath = UnitTestsHelper.DataFile_AllAccounts_Validate;

        if (entityDataSourceType == EntityDataSourceType.UPNB2BGuestAccounts)
        {
            csvPath = UnitTestsHelper.DataFile_GuestAccountsUPN_Validate;
        }

        DataTable dt = DataTable.New.ReadCsv(csvPath);

        foreach (Row row in dt.Rows)
        {
            var registrationData = new ValidateEntityData();
            registrationData.ClaimValue             = row["ClaimValue"];
            registrationData.ShouldValidate         = Convert.ToBoolean(row["ShouldValidate"]);
            registrationData.IsMemberOfTrustedGroup = Convert.ToBoolean(row["IsMemberOfTrustedGroup"]);
            registrationData.UserType = row["UserType"];
            yield return(new TestCaseData(new object[] { registrationData }));
        }
    }
コード例 #7
0
        public virtual void ValidateClaim(ValidateEntityData registrationData)
        {
            if (!TestValidation)
            {
                return;
            }

            bool shouldValidate = registrationData.ShouldValidate;

            if (ExcludeGuestUsers && String.Equals(registrationData.UserType, UnitTestsHelper.GUEST_USERTYPE, StringComparison.InvariantCultureIgnoreCase))
            {
                shouldValidate = false;
            }
            if (ExcludeMemberUsers && String.Equals(registrationData.UserType, UnitTestsHelper.MEMBER_USERTYPE, StringComparison.InvariantCultureIgnoreCase))
            {
                shouldValidate = false;
            }

            SPClaim inputClaim = new SPClaim(UnitTestsHelper.SPTrust.IdentityClaimTypeInformation.MappedClaimType, registrationData.ClaimValue, ClaimValueTypes.String, SPOriginalIssuers.Format(SPOriginalIssuerType.TrustedProvider, UnitTestsHelper.SPTrust.Name));

            UnitTestsHelper.TestValidationOperation(inputClaim, shouldValidate, registrationData.ClaimValue);
        }
コード例 #8
0
        public void RequireExactMatchDuringSearch(ValidateEntityData registrationData)
        {
            int expectedCount = registrationData.ShouldValidate ? 1 : 0;

            UnitTestsHelper.TestSearchOperation(registrationData.ClaimValue, expectedCount, registrationData.ClaimValue);
        }
コード例 #9
0
 public void TestAugmentation(ValidateEntityData registrationData)
 {
     UnitTestsHelper.TestAugmentationOperation(UnitTestsHelper.SPTrust.IdentityClaimTypeInformation.MappedClaimType, registrationData.ClaimValue, registrationData.IsMemberOfTrustedGroup);
 }
コード例 #10
0
 public override void AugmentEntity(ValidateEntityData registrationData)
 {
     base.AugmentEntity(registrationData);
 }
コード例 #11
0
 public override void ValidateClaim(ValidateEntityData registrationData)
 {
     base.ValidateClaim(registrationData);
 }