public void CanCreateMetricWithDuplicateName(AddMetricTestCase testCase) { var serverTiming = new ServerTiming(); serverTiming.Marker(MetricName); Action add = () => testCase.AddMetric(serverTiming, MetricName); add.Should().NotThrow(); }
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"); }
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)); }
public void Marker() { var serverTiming = new ServerTiming(); serverTiming.Marker(MetricName); }