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); }
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 })); } }
//[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(); } }
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 })); } }
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); }
public void RequireExactMatchDuringSearch(ValidateEntityData registrationData) { int expectedCount = registrationData.ShouldValidate ? 1 : 0; UnitTestsHelper.TestSearchOperation(registrationData.ClaimValue, expectedCount, registrationData.ClaimValue); }
public void TestAugmentation(ValidateEntityData registrationData) { UnitTestsHelper.TestAugmentationOperation(UnitTestsHelper.SPTrust.IdentityClaimTypeInformation.MappedClaimType, registrationData.ClaimValue, registrationData.IsMemberOfTrustedGroup); }
public override void AugmentEntity(ValidateEntityData registrationData) { base.AugmentEntity(registrationData); }
public override void ValidateClaim(ValidateEntityData registrationData) { base.ValidateClaim(registrationData); }