Skip to content

Commit 389591c

Browse files
committed
test: add overload check
1 parent cb6a4d4 commit 389591c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/ServiceCollecttionExtensionsTests.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ public void AddMetricPusherService_WithZeroTimeInterval_ThrowsArgumentOutOfRange
2626
act.Should().Throw<ArgumentOutOfRangeException>();
2727
}
2828

29+
[Fact]
30+
public void AddMetricPusherService_WithDefaultInterval_AddsMetricPusherServiceInServiceCollection()
31+
{
32+
var servicesCollection = new ServiceCollection();
33+
var metricPusher = Substitute.For<IMetricPusher>();
34+
35+
servicesCollection.AddMetricPusherService(metricPusher);
36+
var provider = servicesCollection.BuildServiceProvider();
37+
var service = provider.GetRequiredService<IHostedService>();
38+
39+
service.Should().BeOfType<MetricPusherService>();
40+
}
41+
2942
[Fact]
3043
public void AddMetricPusherService_WithValidParameterValues_AddsMetricPusherServiceInServiceCollection()
3144
{

0 commit comments

Comments
 (0)