Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -7,7 +7,8 @@ namespace StellaOps.Scanner.WebService.Tests;
|
||||
|
||||
public sealed class PlatformEventPublisherRegistrationTests
|
||||
{
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void NullPublisherRegisteredWhenEventsDisabled()
|
||||
{
|
||||
using var factory = new ScannerApplicationFactory().WithOverrides(configuration =>
|
||||
@@ -21,7 +22,8 @@ public sealed class PlatformEventPublisherRegistrationTests
|
||||
Assert.IsType<NullPlatformEventPublisher>(publisher);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void RedisPublisherRegisteredWhenEventsEnabled()
|
||||
{
|
||||
var originalEnabled = Environment.GetEnvironmentVariable("SCANNER__EVENTS__ENABLED");
|
||||
@@ -51,6 +53,7 @@ public sealed class PlatformEventPublisherRegistrationTests
|
||||
});
|
||||
using var scope = factory.Services.CreateScope();
|
||||
|
||||
using StellaOps.TestKit;
|
||||
var options = scope.ServiceProvider.GetRequiredService<IOptions<ScannerWebServiceOptions>>().Value;
|
||||
Assert.True(options.Events.Enabled);
|
||||
Assert.Equal("redis", options.Events.Driver);
|
||||
|
||||
Reference in New Issue
Block a user