diff --git a/Vostok.Hosting.Tests/VostokHostingEnvironmentFactory_Tests.cs b/Vostok.Hosting.Tests/VostokHostingEnvironmentFactory_Tests.cs index eed25977..8ec834fa 100644 --- a/Vostok.Hosting.Tests/VostokHostingEnvironmentFactory_Tests.cs +++ b/Vostok.Hosting.Tests/VostokHostingEnvironmentFactory_Tests.cs @@ -150,6 +150,17 @@ public void Should_provide_system_metrics_extensions() environment.HostExtensions.TryGet(out _).Should().BeTrue(); } + [Test] + public void Should_provide_dev_null_metric_context_when_diagnostic_metrics_disabled_and_no_senders() + { + var environment = VostokHostingEnvironmentFactory.Create(Setup, new VostokHostingEnvironmentFactorySettings + { + DiagnosticMetricsEnabled = false + }); + + environment.Metrics.Root.Should().BeOfType(); + } + [Test] public void Should_provide_dev_null_metric_context_when_no_metric_event_senders_built() { @@ -163,7 +174,7 @@ void SetupForDevNullMetricContext(IVostokHostingEnvironmentBuilder builder) builder.SetupDiagnostics(x => x.CustomizeInfo(s => s.AddApplicationMetricsInfo = false)); // disable ApplicationMetricsProvider metrics sender } } - + [Test] public void Should_provide_not_dev_null_metric_context_when_metric_event_senders_built() {