public void DisposableMetric() { var metric = new DisposableMetric(MetricName); metric.Dispose(); metric.Validate(out _); }
public void ValidateReturnsTrueWhenMetricDisposed() { var metric = new DisposableMetric("foo"); metric.Dispose(); metric.Validate(out _).Should().BeTrue(); }
public void ValidateReturnsFalseWhenMetricNotDisposed() { var metric = new DisposableMetric("foo"); metric.Validate(out var message).Should().BeFalse(); message.Should().Contain("has not been disposed"); }
public void DisposeCalculatesDuration() { var metric = new DisposableMetric("foo"); metric.Dispose(); metric.Duration.HasValue.Should().BeTrue(); }
public void InitialStateSetFromConstructor() { const string name = "foo"; const string description = "description"; var metric = new DisposableMetric(name, description); metric.Name.Should().Be(name); metric.Description.Should().Be(description); metric.Duration.Should().BeNull(); }