In addition to taking into account scheduled work, also check if there are actual activity instances still running
31 lines
787 B
C#
31 lines
787 B
C#
using Testcontainers.Redis;
|
|
|
|
namespace Elsa.ProtoCluster.ComponentTests.AzureContainerAppTests;
|
|
|
|
public class RedisFixture : IAsyncLifetime
|
|
{
|
|
private RedisContainer? _redisContainer;
|
|
|
|
public async Task InitializeAsync()
|
|
{
|
|
_redisContainer = new RedisBuilder()
|
|
.WithPortBinding(6379, true)
|
|
.Build();
|
|
|
|
await _redisContainer.StartAsync().ConfigureAwait(false);
|
|
}
|
|
|
|
public string GetConnectionString()
|
|
{
|
|
return _redisContainer != null ?
|
|
_redisContainer.GetConnectionString() :
|
|
throw new InvalidOperationException("Redis container not initialized.");
|
|
}
|
|
|
|
public async Task DisposeAsync()
|
|
{
|
|
if(_redisContainer != null)
|
|
await _redisContainer.StopAsync();
|
|
}
|
|
}
|