Skip to content

Commit

Permalink
Use correct overload for new Registration tests
Browse files Browse the repository at this point in the history
Also renamed tests to be more human-readable
  • Loading branch information
NielsPilgaard committed Feb 15, 2023
1 parent 8aa50e0 commit 31b3095
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions test/EventStore.Client.Streams.Tests/DependencyInjectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,42 @@ public void Register() =>
.GetRequiredService<EventStoreClient>();

[Fact]
public void RegisterWithServiceProvider() =>
public void RegisterWithConnectionString() =>
new ServiceCollection()
.AddEventStoreClient(provider => { })
.AddEventStoreClient("esdb://localhost:2113?tls=false")
.BuildServiceProvider()
.GetRequiredService<EventStoreClient>();

[Fact]
public void RegisterSimple() =>
public void RegisterWithConnectionStringFactory() =>
new ServiceCollection()
.AddEventStoreClient(connectionStringFactory: provider => "esdb://localhost:2113?tls=false")
.BuildServiceProvider()
.GetRequiredService<EventStoreClient>();

[Fact]
public void RegisterWithUri() =>
new ServiceCollection()
.AddEventStoreClient(new Uri("https://localhost:1234"))
.BuildServiceProvider()
.GetRequiredService<EventStoreClient>();

[Fact]
public void RegisterSimpleWithServiceProvider() =>
public void RegisterWithUriFactory() =>
new ServiceCollection()
.AddEventStoreClient(provider => new Uri("https://localhost:1234"))
.BuildServiceProvider()
.GetRequiredService<EventStoreClient>();

[Fact]
public void RegisterWithAction() =>
public void RegisterWithSettings() =>
new ServiceCollection()
.AddEventStoreClient(settings => { })
.BuildServiceProvider()
.GetRequiredService<EventStoreClient>();

[Fact]
public void RegisterWithActionAndServiceProvider() =>
public void RegisterWithSettingsFactory() =>
new ServiceCollection()
.AddEventStoreClient(provider => settings => { })
.BuildServiceProvider()
Expand Down

0 comments on commit 31b3095

Please sign in to comment.