27 lines
923 B
C#
27 lines
923 B
C#
using ItWorx.KnowledgeHub.Application.Migration;
|
|
using ItWorx.KnowledgeHub.Infrastructure;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace ItWorx.KnowledgeHub.Api.Tests;
|
|
|
|
public sealed class LeafWikiAdapterLifetimeTests
|
|
{
|
|
[Fact]
|
|
public void Preflight_catalog_resolves_with_scope_validation_enabled()
|
|
{
|
|
var configuration = new ConfigurationBuilder().AddInMemoryCollection().Build();
|
|
var services = new ServiceCollection();
|
|
services.AddSingleton<IConfiguration>(configuration);
|
|
services.AddKnowledgeHubInfrastructure(configuration);
|
|
|
|
using var provider = services.BuildServiceProvider(new ServiceProviderOptions
|
|
{
|
|
ValidateScopes = true
|
|
});
|
|
using var scope = provider.CreateScope();
|
|
|
|
Assert.NotNull(scope.ServiceProvider.GetRequiredService<ILeafWikiAdapterCatalog>());
|
|
}
|
|
}
|