From 31b309574b10b287f2d4fa7d2b93603e9c50179f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Pilgaard=20Gr=C3=B8ndahl?= Date: Wed, 15 Feb 2023 19:50:27 +0100 Subject: [PATCH] Use correct overload for new Registration tests Also renamed tests to be more human-readable --- .../DependencyInjectionTests.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/test/EventStore.Client.Streams.Tests/DependencyInjectionTests.cs b/test/EventStore.Client.Streams.Tests/DependencyInjectionTests.cs index 91d4cfc65..2d476c098 100644 --- a/test/EventStore.Client.Streams.Tests/DependencyInjectionTests.cs +++ b/test/EventStore.Client.Streams.Tests/DependencyInjectionTests.cs @@ -13,35 +13,42 @@ public void Register() => .GetRequiredService(); [Fact] - public void RegisterWithServiceProvider() => + public void RegisterWithConnectionString() => new ServiceCollection() - .AddEventStoreClient(provider => { }) + .AddEventStoreClient("esdb://localhost:2113?tls=false") .BuildServiceProvider() .GetRequiredService(); [Fact] - public void RegisterSimple() => + public void RegisterWithConnectionStringFactory() => + new ServiceCollection() + .AddEventStoreClient(connectionStringFactory: provider => "esdb://localhost:2113?tls=false") + .BuildServiceProvider() + .GetRequiredService(); + + [Fact] + public void RegisterWithUri() => new ServiceCollection() .AddEventStoreClient(new Uri("https://localhost:1234")) .BuildServiceProvider() .GetRequiredService(); [Fact] - public void RegisterSimpleWithServiceProvider() => + public void RegisterWithUriFactory() => new ServiceCollection() .AddEventStoreClient(provider => new Uri("https://localhost:1234")) .BuildServiceProvider() .GetRequiredService(); [Fact] - public void RegisterWithAction() => + public void RegisterWithSettings() => new ServiceCollection() .AddEventStoreClient(settings => { }) .BuildServiceProvider() .GetRequiredService(); [Fact] - public void RegisterWithActionAndServiceProvider() => + public void RegisterWithSettingsFactory() => new ServiceCollection() .AddEventStoreClient(provider => settings => { }) .BuildServiceProvider()