Skip to content

Commit

Permalink
Improve fixture code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken committed Jan 17, 2024
1 parent aee9981 commit 09a63cc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ public sealed class MognoContainerCollectionFixture : ICollectionFixture<MongoCo

public sealed class MongoContainerFixture : IAsyncLifetime
{
public string ConnectionString { get; private set; } = string.Empty;
public string? ConnectionString => _container?.GetConnectionString();

private readonly MongoDbContainer _container;

public MongoContainerFixture()
Expand All @@ -19,7 +20,6 @@ public MongoContainerFixture()
public async Task InitializeAsync()
{
await _container.StartAsync();
ConnectionString = _container.GetConnectionString();
}

public async Task DisposeAsync()
Expand Down

0 comments on commit 09a63cc

Please sign in to comment.