Пример #1
0
        public void Should_be_possible_to_build_a_probeExecution_with_error_status_and_execution_logs_if_not_collect_was_executed()
        {
            CollectFactory collectFactory = new CollectFactory(provider.GetSession());
            ProbeResult probeResult = probeResultFactory.CreateProbeResultForRegostryCollectWithError();

            ExecutionLogBuilder executionLog = new ExecutionLogBuilder();
            executionLog.StartCollectOf("registry");
            executionLog.TryConnectToHost("176.16.3.22");
            executionLog.AnErrorOccurred("Error connecting to host");
            executionLog.EndCollect();

            ProbeExecution probeExecution = collectFactory.CreateAProbeExecutionWithError("registry", executionLog.BuildExecutionLogs());
            Assert.IsNotNull(probeExecution);
            Assert.AreEqual("registry", probeExecution.Capability);
            Assert.IsTrue(probeExecution.ExecutionLogs.Count == 4, "the probe execution not have executionLogs expecteds");
            Assert.IsTrue(probeExecution.HasErrors(), "the probe execution not have a status expected");
        }
Пример #2
0
        public void Shoud_be_possible_to_build_a_probeExecution_with_the_error_status_if_not_collect_was_executed()
        {

            CollectFactory collectFactory = new CollectFactory(provider.GetSession());
            ProbeResult probeResult = probeResultFactory.CreateProbeResultForRegostryCollectWithError();

            ProbeExecution probeExecution = collectFactory.CreateAProbeExecutionWithError("registry", "Erro connecting to host");
            Assert.IsNotNull(probeExecution);
            Assert.AreEqual("registry", probeExecution.Capability);
            Assert.IsTrue(probeExecution.ExecutionLogs.Count == 1, "the probe execution not have executionLogs expecteds");            
            Assert.IsTrue(probeExecution.HasErrors(), "the probe execution not have a status expected");
        }