Skip to content

Commit

Permalink
Update docs/modules/neo4j.md
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmeisterAn authored Oct 5, 2023
1 parent aa05169 commit 162a4c3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/modules/neo4j.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@ namespace TestcontainersModules;

public class Neo4jContainerTest : IAsyncLifetime
{
private readonly Neo4jContainer neo4JContainer
= new Neo4jBuilder().Build();
private readonly Neo4jContainer neo4jContainer
= new Neo4jBuilder()
.Build();

[Fact]
public async Task CanReadNeo4jDatabase()
{
const string database = "neo4j";
var connectionString = neo4JContainer.GetConnectionString();
await using var client = GraphDatabase.Driver(connectionString);

await using var session =
client.AsyncSession(cfg => cfg.WithDatabase(database));
await using var client = GraphDatabase.Driver(neo4jContainer.GetConnectionString());

await using var session = client.AsyncSession(cfg => cfg.WithDatabase(database));

Assert.Equal(database, session.SessionConfig.Database);
}

public Task InitializeAsync()
=> neo4JContainer.StartAsync();
=> neo4jContainer.StartAsync();

public Task DisposeAsync()
=> neo4JContainer.DisposeAsync().AsTask();
=> neo4jContainer.DisposeAsync().AsTask();
}
```

Expand Down

0 comments on commit 162a4c3

Please sign in to comment.