Esempio n. 1
0
        public void CanCreateMetricWithDuplicateName(AddMetricTestCase testCase)
        {
            var serverTiming = new ServerTiming();

            serverTiming.Marker(MetricName);
            Action add = () => testCase.AddMetric(serverTiming, MetricName);

            add.Should().NotThrow();
        }
Esempio n. 2
0
        public void CannotCreateMetricWithWhitespaceName(AddMetricTestCase testCase)
        {
            var serverTiming = new ServerTiming();

            serverTiming.Marker(MetricName);
            Action add = () => testCase.AddMetric(serverTiming, " ");

            add.Should().Throw <ArgumentException>()
            .Which.ParamName.Should().Be("name");
        }
Esempio n. 3
0
        public void GetMetricsReturnsAllMetrics()
        {
            var serverTiming = new ServerTiming();

            for (var i = 0; i < 5; i++)
            {
                serverTiming.Marker($"{MetricName}-{i}");
            }

            serverTiming.GetMetrics().Should().HaveCount(5)
            .And.OnlyContain(m => m.Name.StartsWith(MetricName));
        }
Esempio n. 4
0
        public void Marker()
        {
            var serverTiming = new ServerTiming();

            serverTiming.Marker(MetricName);
        }