public void Init() { Console.WriteLine($"Starting augmentation test {TestContext.CurrentContext.Test.Name}..."); Config = AzureCPConfig.GetConfiguration(UnitTestsHelper.ClaimsProviderConfigName, UnitTestsHelper.SPTrust.Name); BackupConfig = Config.CopyPersistedProperties(); Config.EnableAugmentation = true; Config.Update(); }
public static void InitializeConfiguration(AzureCPConfig config) { config.ResetCurrentConfiguration(); #if DEBUG config.Timeout = 99999; #endif string json = File.ReadAllText(AzureTenantsJsonFile); List <AzureTenant> azureTenants = JsonConvert.DeserializeObject <List <AzureTenant> >(json); config.AzureTenants = azureTenants; config.Update(); }
public static void InitializeConfiguration(AzureCPConfig config) { config.ResetCurrentConfiguration(); #if DEBUG config.Timeout = 99999; #endif string json = File.ReadAllText(AzureTenantsJsonFile); List <AzureTenant> azureTenants = JsonConvert.DeserializeObject <List <AzureTenant> >(json); config.AzureTenants = azureTenants; config.Update(); Trace.WriteLine($"{DateTime.Now.ToString("s")} Set {config.AzureTenants.Count} Azure AD tenants to AzureCP configuration"); }
public void ModifyOrDeleteIdentityClaimTypeConfig() { // Delete identity claim type from ClaimTypes list based on its claim type should throw exception InvalidOperationException string identityClaimType = UnitTestsHelper.SPTrust.IdentityClaimTypeInformation.MappedClaimType; Assert.Throws <InvalidOperationException>(() => Config.ClaimTypes.Remove(identityClaimType), $"Delete identity claim type from ClaimTypes list should throw exception InvalidOperationException with this message: \"Cannot delete claim type \"{UnitTestsHelper.SPTrust.IdentityClaimTypeInformation.MappedClaimType}\" because it is the identity claim type of \"{UnitTestsHelper.SPTrust.Name}\"\""); // Delete identity claim type from ClaimTypes list based on its ClaimTypeConfig should throw exception InvalidOperationException ClaimTypeConfig identityCTConfig = Config.ClaimTypes.FirstOrDefault(x => String.Equals(UnitTestsHelper.SPTrust.IdentityClaimTypeInformation.MappedClaimType, x.ClaimType, StringComparison.InvariantCultureIgnoreCase)); Assert.Throws <InvalidOperationException>(() => Config.ClaimTypes.Remove(identityClaimType), $"Delete identity claim type from ClaimTypes list should throw exception InvalidOperationException with this message: \"Cannot delete claim type \"{UnitTestsHelper.SPTrust.IdentityClaimTypeInformation.MappedClaimType}\" because it is the identity claim type of \"{UnitTestsHelper.SPTrust.Name}\"\""); // Modify identity ClaimTypeConfig to set its EntityType to Group should throw exception InvalidOperationException identityCTConfig.EntityType = DirectoryObjectType.Group; Assert.Throws <InvalidOperationException>(() => Config.Update(), $"Modify identity claim type to set its EntityType to Group should throw exception InvalidOperationException with this message: \"{ConfigUpdateErrorMessage}\""); }
public void Cleanup() { Config.ApplyConfiguration(BackupConfig); Config.Update(); Console.WriteLine($"Restored actual configuration."); }
public void Cleanup() { Config.ApplyConfiguration(BackupConfig); Config.Update(); }
public void Cleanup() { Config.ApplyConfiguration(BackupConfig); Config.Update(); Trace.WriteLine($"{DateTime.Now.ToString("s")} Restored original settings of AzureCP configuration"); }