public virtual void AugmentEntity(ValidateEntityData registrationData)
        {
            if (!TestAugmentation)
            {
                return;
            }

            UnitTestsHelper.TestAugmentationOperation(UnitTestsHelper.SPTrust.IdentityClaimTypeInformation.MappedClaimType, registrationData.ClaimValue, registrationData.IsMemberOfTrustedGroup);
        }
 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);
 }
        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);
        }
Beispiel #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 }));
        }
    }
Beispiel #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();
            }
        }
Beispiel #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 }));
        }
    }
Beispiel #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);
        }
Beispiel #8
0
        public void RequireExactMatchDuringSearch(ValidateEntityData registrationData)
        {
            int expectedCount = registrationData.ShouldValidate ? 1 : 0;

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