fix(DIExtensions): ConsumerOptions-Eingabe in AddAuthService-Methode hinzugefügt, um Konsuemrn nach der Übernahme aus der Config arrangieren zu können.
- Standardiezd consumerKey Benennung
This commit is contained in:
@@ -5,7 +5,6 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using DigitalData.Auth.API.Services;
|
||||
using DigitalData.Auth.API.Services.Contracts;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace DigitalData.Auth.Tests.API;
|
||||
|
||||
@@ -17,7 +16,7 @@ public class AuthHubTests
|
||||
|
||||
private Func<Action<ClientParams>, ServiceProvider> Build;
|
||||
|
||||
private WebApplication? _app = null;
|
||||
private readonly WebApplication? _app = null;
|
||||
|
||||
private readonly Queue<IAsyncDisposable> _disposableAsync = new();
|
||||
|
||||
@@ -52,13 +51,12 @@ public class AuthHubTests
|
||||
// Create and run test server
|
||||
// Create builder and add SignalR service
|
||||
var builder = WebApplication.CreateBuilder();
|
||||
builder.Configuration.AddInMemoryCollection(new Dictionary<string, string?>()
|
||||
{
|
||||
{ "Consumers", null }
|
||||
});
|
||||
var config = builder.Configuration;
|
||||
builder.Services.AddSignalR();
|
||||
builder.Services.AddAuthService(config);
|
||||
builder.Services.AddAuthService(
|
||||
config,
|
||||
consumers => consumers.Add(new(0, "mock", "123", "client.mock")) // Set mock consumer
|
||||
);
|
||||
|
||||
// Listen AvailablePort and map hub
|
||||
var _app = builder.Build();
|
||||
@@ -69,8 +67,6 @@ public class AuthHubTests
|
||||
_app.MapHub<Auth.API.Hubs.AuthHub>(hubRoute);
|
||||
_app.Start();
|
||||
|
||||
_disposableAsync.Enqueue(_app);
|
||||
|
||||
// Create notifier by app services
|
||||
_notifier = _app.Services.GetRequiredService<INotifier>();
|
||||
}
|
||||
@@ -82,6 +78,7 @@ public class AuthHubTests
|
||||
if (_app is not null)
|
||||
{
|
||||
await _app.StopAsync();
|
||||
await _app.DisposeAsync();
|
||||
Console.WriteLine("Test server stopped.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user