Example #1
0
        public void Verify_probe_healthy_condition()
        {
            var knowledgeBaseProvider = _provider.GetService <IKnowledgeBaseProvider>();
            var probe = new ChannelThrottlingProbe(knowledgeBaseProvider);

            ChannelSnapshot snapshot = new FakeChannelSnapshot1("Channel1", 6, 2, 5, 8, 4, 1);

            var result = probe.Execute(snapshot);

            result.Status.ShouldBe(ProbeResultStatus.Healthy);
            result.KB.Id.ShouldBe(typeof(ChannelThrottlingProbe).GetIdentifier());
        }
Example #2
0
        public void Verify_probe_healthy_condition()
        {
            var knowledgeBaseProvider = _services.GetService <IKnowledgeBaseProvider>();
            var probe = new ChannelThrottlingProbe(knowledgeBaseProvider);

            ChannelSnapshot snapshot = new ChannelSnapshot()
            {
                PrefetchCount = 6,
                UncommittedAcknowledgements = 2,
                UncommittedMessages         = 5,
                UnconfirmedMessages         = 8,
                UnacknowledgedMessages      = 4,
                Consumers  = 1,
                Identifier = "Channel1"
            };

            var result = probe.Execute(snapshot);

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