public void Verify_probe_na()
        {
            var knowledgeBaseProvider = _provider.GetService <IKnowledgeBaseProvider>();
            var probe = new QueueLowFlowProbe(null, knowledgeBaseProvider);

            QueueSnapshot snapshot = new FakeQueueSnapshot5(100);

            var result = probe.Execute(snapshot);

            result.Status.ShouldBe(ProbeResultStatus.NA);
            result.KB.Id.ShouldBe(typeof(QueueLowFlowProbe).GetIdentifier());
        }
        public void Verify_probe_healthy_condition()
        {
            var knowledgeBaseProvider = _provider.GetService <IKnowledgeBaseProvider>();
            var config = _provider.GetService <HareDuConfig>();
            var probe  = new QueueLowFlowProbe(config.Diagnostics, knowledgeBaseProvider);

            QueueSnapshot snapshot = new FakeQueueSnapshot5(100);

            var result = probe.Execute(snapshot);

            result.Status.ShouldBe(ProbeResultStatus.Healthy);
            result.KB.Id.ShouldBe(typeof(QueueLowFlowProbe).GetIdentifier());
        }
Exemplo n.º 3
0
        public void Verify_probe_na()
        {
            var knowledgeBaseProvider = _services.GetService <IKnowledgeBaseProvider>();
            var probe = new QueueLowFlowProbe(null, knowledgeBaseProvider);

            QueueSnapshot snapshot = new () { Messages = new () { Incoming = new () { Total = 100 } } };

            var result = probe.Execute(snapshot);

            Assert.Multiple(() =>
            {
                Assert.AreEqual(ProbeResultStatus.NA, result.Status);
                Assert.AreEqual(typeof(QueueLowFlowProbe).GetIdentifier(), result.KB.Id);
            });
        }
    }
Exemplo n.º 4
0
        public void Verify_probe_healthy_condition()
        {
            HareDuConfig config = new () { Diagnostics = new () { Probes = new () { QueueLowFlowThreshold = 20 } } };
            var          knowledgeBaseProvider = _services.GetService <IKnowledgeBaseProvider>();
            var          probe = new QueueLowFlowProbe(config.Diagnostics, knowledgeBaseProvider);

            QueueSnapshot snapshot = new () { Messages = new () { Incoming = new () { Total = 100 } } };

            var result = probe.Execute(snapshot);

            Assert.Multiple(() =>
            {
                Assert.AreEqual(ProbeResultStatus.Healthy, result.Status);
                Assert.AreEqual(typeof(QueueLowFlowProbe).GetIdentifier(), result.KB.Id);
            });
        }

        [Test]