Path: redb-route/tests/redb.Route.Tests.Redis/TestRedis.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Redis/TestRedis.cs
----
using StackExchange.Redis;
namespace redb.Route.Tests.Redis;
///
/// The one connection the tests use to set up and check data beside the connector. A multiplexer per call was never
/// disposed: the suite left hundreds of open connections behind, and on a slow Linux stand behind a TCP forwarder
/// their reads broke off mid-test.
///
internal static class TestRedis
{
private const string ConnectionString = "localhost:6379";
private static readonly Lazy> Shared =
new(() => ConnectionMultiplexer.ConnectAsync(ConnectionString));
/// The database of the shared test connection.
public static async Task Database() => (await Shared.Value.ConfigureAwait(false)).GetDatabase();
}