Skip to content

Commit

Permalink
+ test
Browse files Browse the repository at this point in the history
  • Loading branch information
kunga committed Oct 1, 2021
1 parent f4bf238 commit 801f883
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Vostok.Hosting.Tests/VostokHostingEnvironmentFactory_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@ public void Should_provide_system_metrics_extensions()
environment.HostExtensions.TryGet<CurrentProcessMonitor>(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<DevNullMetricContext>();
}

[Test]
public void Should_provide_dev_null_metric_context_when_no_metric_event_senders_built()
{
Expand All @@ -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()
{
Expand Down

0 comments on commit 801f883

Please sign in to comment.