Пример #1
0
        public void MetricSpace_WhenCombiningThreeKeys_ShouldMatchPattern()
        {
            var space = new MetricSpace(Key1);

            var sut = space.Space(Key2);

            var metricInfo = new MetricInfo();

            sut.Meter(Key3).Send(metricInfo);

            var result = metricInfo.Key;

            Assert.Equal($"{Key1}.{Key2}.{Key3}", result);
        }
Пример #2
0
        public void MetricSpace_WhenReplcingKeyFormater_ShouldMatchPattern()
        {
            var space = new MetricSpace(Key1);

            space.Options.KeyFormater = new TestFormatter();

            var sut = space.Space(Key2);

            var metricInfo = new MetricInfo();

            sut.Meter(Key3).Send(metricInfo);

            var result = metricInfo.Key;

            Assert.Equal(TestFormatter.Key, result);
        }
Пример #3
0
        public void MetricSpace_WhenUsingDifferntDelimiterOnMultiSpace_ShouldMatchPattern()
        {
            const string delimiter = ";";

            var space = new MetricSpace(Key1);

            space.Options.KeysDelimiter = delimiter;

            var sut = space.Space(Key2);

            var metricInfo = new MetricInfo();

            sut.Meter(Key3).Send(metricInfo);

            var result = metricInfo.Key;

            Assert.Equal($"{Key1}{delimiter}{Key2}{delimiter}{Key3}", result);
        }