Skip to content

Commit

Permalink
Dispose tracker in tests before it loses scope.
Browse files Browse the repository at this point in the history
  • Loading branch information
tillig committed Sep 2, 2024
1 parent 344c14b commit f2170d3
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,10 @@ public void ServiceScopesAreFlat()
[Fact]
public void ServiceInstancesRegisteredAreNotDisposedWhenTheProviderIsDisposed()
{
var externalService = new DisposeTracker();
using var externalService = new DisposeTracker();
var services = new ServiceCollection().AddSingleton(externalService);
var rootProvider = CreateServiceProvider(services);
((IDisposable)rootProvider).Dispose();

Assert.False(externalService.Disposed);
}

Expand Down

0 comments on commit f2170d3

Please sign in to comment.