Example #1
0
        static int Test(TestOptions 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(_localizationRepository.GetText("INFO00002", app.application_name));
                bool doesScanConfirm;
                if (options.LastScan)
                {
                    _logger.LogInformation(_localizationRepository.GetText("INFO00003"));
                    doesScanConfirm = _dscLogic.ConformToPreviousScan(app, app.modules.ToArray());
                }
                else
                {
                    _logger.LogInformation(_localizationRepository.GetText("INFO00004"));
                    doesScanConfirm = _dscLogic.ConformConfiguration(app,
                                                                     app.upload.ToArray(),
                                                                     app.modules.ToArray(), true);
                }

                if (doesScanConfirm)
                {
                    _logger.LogInformation(_localizationRepository.GetText("INFO00005", app.application_name));
                }
                else
                {
                    _logger.LogWarning(_localizationRepository.GetText("WARN00001", app.application_name));
                }
            }

            _logger.LogInformation(_localizationRepository.GetText("INFO00006"));
            _logger.LogDebug($"Exiting {LoggingHelper.GetMyMethodName()} with value {1}");
            return(1);
        }