public void TestBackup() { var environmentRepository = new EnvironmentRepository(connectionString); EnvironmentBackupper.Backup(environmentRepository); var backedUpEnvironment = environmentRepository.GetBackupEnvironments().FirstOrDefault(); Assert.NotNull(backedUpEnvironment); Assert.Null(backedUpEnvironment.EnvironmentVariables.FirstOrDefault(v => v.Name == "_CHAMI_ENV")); // We remove the environment we just added to make sure we can execute this test again. environmentRepository.DeleteEnvironmentById(backedUpEnvironment.EnvironmentId); }
/// <summary> /// Performs a backup of the current state of environment variables, excluding those that belong to a Chami environment. /// </summary> public void BackupEnvironment() { EnvironmentBackupper.Backup(_repository); }