Esempio n. 1
0
        public void Should_be_possible_to_build_an_execution_log_in_steps_with_custom_warning_logs()
        {
            ExecutionLogBuilder executionLog = new ExecutionLogBuilder();
            executionLog.StartCollectOf("Registry");
            executionLog.TryConnectToHost("176.16.3.166");
            executionLog.ConnectedWithSuccess();
            executionLog.CollectingInformationFrom("oval:id:7589");
            executionLog.CollectingDataFrom("Key: HKEY_LOCAL_MACHINE\\software\\microsoft\\windows\\currentVersion\\BuildType");

            executionLog.Warning("The key of registry item is not exists");

            executionLog.EndCollect();
            IEnumerable<ProbeLogItem> executionsLog = executionLog.BuildExecutionLogs();
            Assert.AreEqual(7, executionsLog.Count());
            Assert.AreEqual(TypeItemLog.Warning, executionsLog.ElementAt(5).Type, "the type of log is not expected");
        }
Esempio n. 2
0
        public void should_be_possible_to_buid_an_execution_log_in_steps_informing_what_element_is_collected()
        {
            string element = "Key: HKEY_LOCAL_MACHINE\\software\\microsoft\\windows\\currentVersion\\BuildType";
            ExecutionLogBuilder executionLog = new ExecutionLogBuilder();
            executionLog.StartCollectOf("Registry");
            executionLog.TryConnectToHost("176.16.3.166");
            executionLog.ConnectedWithSuccess();
            executionLog.CollectingInformationFrom("oval:id:7858");

            executionLog.CollectingDataFrom(element);

            executionLog.EndCollect();

            IEnumerable<ProbeLogItem> executionsLog = executionLog.BuildExecutionLogs();

            Assert.AreEqual(6, executionsLog.Count());
        }