Example #1
0
        static int Delete(DeleteOptions options)
        {
            _logger.LogDebug($"Entering {LoggingHelper.GetMyMethodName()} with scan options {options}");
            var _localizationRepository = LoggingHelper.GetLocalizationRepository(options.Language);

            _logger.LogInformation(_localizationRepository.GetText("INFO00001", options.ToString()));

            var declareConfigRepository = new DeclareConfigurationRepository(options.JsonFileLocation);

            foreach (var app in declareConfigRepository.Apps())
            {
                _logger.LogInformation($"Tearing down {app.application_name}");
                _dscLogic.TearDownProfile(app);
                _logger.LogInformation($"Tear down complete for {app.application_name}");
            }

            _logger.LogDebug($"Exiting {LoggingHelper.GetMyMethodName()} with value {1}");
            return(1);
        }
Example #2
0
        public void TearDownFromConfiguration()
        {
            foreach (var app in application_profiles)
            {
                _dscLogic.TearDownProfile(app);
                var retrievedApp = _veracodeRepository.GetAllApps().Where(x => x.app_name == app.application_name).SingleOrDefault();
                Assert.IsNull(retrievedApp);

                var retrievedPolicy = _veracodeRepository.GetPolicies().Where(x => x.name == app.application_name).SingleOrDefault();
                Assert.IsNull(retrievedApp);

                var retrievedTeam = _veracodeRepository.GetTeams().Where(x => x.team_name == app.application_name).SingleOrDefault();
                Assert.IsNull(retrievedTeam);

                foreach (var user in app.users)
                {
                    var retrievedUser = _veracodeRepository.GetUsers().Where(x => x == user.email_address).SingleOrDefault();
                    Assert.IsNull(retrievedUser);
                }
            }
        }