elsa-core/test/component/Elsa.ProtoCluster.ComponentTests/AzureContainerAppTests/RedisFixture.cs
Sipke Schoorstra 815b544f53 Update Flowchart completion logic
In addition to taking into account scheduled work, also check if there are actual activity instances still running
2023-08-04 11:45:07 +02:00

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();
}
}