From 801f883232d0c282db742ec3305a3d9814254274 Mon Sep 17 00:00:00 2001 From: kungurtsev Date: Fri, 1 Oct 2021 14:07:25 +0500 Subject: [PATCH] + test --- .../VostokHostingEnvironmentFactory_Tests.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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() {