예제 #1
0
        public void Send_OnIHaveMeta_DoesCallEnrichMessage()
        {
            ISensuEnricher enricher = new HostInfoEnricher();
            var            sut      = new MockSensuClient();

            sut.EnrichWith(enricher);
            sut.Send(new Ok("app_name", "some_metric"));
            Assert.True(sut.Enriched);
        }
예제 #2
0
        public void Send_OnNotIHaveMeta_DoesNotCallEnrichMessage()
        {
            ISensuEnricher enricher = new HostInfoEnricher();
            var            sut      = new MockSensuClient();

            sut.EnrichWith(enricher);
            sut.Send(new {});
            Assert.False(sut.Enriched);
        }
예제 #3
0
        public void EnrichMessage_OnIHaveMeta_AddsMeta()
        {
            ISensuEnricher enricher = new HostInfoEnricher();
            var            sut      = new MockSensuClient();

            sut.EnrichWith(enricher);
            var message = new Ok("app_name", "some_metric");

            sut.Send(message);
            Assert.True(message.Meta.ContainsKey("host_name"));
        }