Пример #1
0
        public void Test_IncompleteConfiguration_ModuleConfiguration()
        {
            SetupIncompleteConfiguration();
            TearDownFromConfiguration();
            SetupFromConfiguration();
            var results = new List <KeyValuePair <string, bool> >();

            foreach (var app in application_profiles)
            {
                var doesScanConfirm = _dscLogic.ConformConfiguration(app,
                                                                     app.upload.ToArray(),
                                                                     app.modules.ToArray(), true);

                results.Add(new KeyValuePair <string, bool>(
                                app.application_name,
                                doesScanConfirm
                                ));
            }

            foreach (var summary in results)
            {
                var message = summary.Value ? "DOES" : "DOES NOT";
                Console.Write($"Application {summary.Key} scan config {message} conform.");
                Assert.IsFalse(summary.Value);
            }

            TearDownFromConfiguration();
        }
Пример #2
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);
        }