From e6c606f9eaf7389c6412de73e562aa0957ea4ffa Mon Sep 17 00:00:00 2001 From: haysch <36488481+haysch@users.noreply.github.com> Date: Thu, 10 Aug 2023 21:12:29 +0200 Subject: [PATCH] Minor clarification by moving initialization to constructor --- tests/NRedisStack.Tests/RedisFixture.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/NRedisStack.Tests/RedisFixture.cs b/tests/NRedisStack.Tests/RedisFixture.cs index 8ae470f2..f971d04f 100644 --- a/tests/NRedisStack.Tests/RedisFixture.cs +++ b/tests/NRedisStack.Tests/RedisFixture.cs @@ -4,17 +4,18 @@ namespace NRedisStack.Tests { public class RedisFixture : IDisposable { - - - // Set the enviroment variable to specify your own alternet host and port: - string redis = Environment.GetEnvironmentVariable("REDIS") ?? "localhost:6379"; - public RedisFixture() => Redis = ConnectionMultiplexer.Connect($"{redis}"); + public RedisFixture() + { + // Set the enviroment variable to specify your own alternet host and port: + var redisConnectionString = Environment.GetEnvironmentVariable("REDIS") ?? "localhost:6379"; + Redis = ConnectionMultiplexer.Connect(redisConnectionString); + } public void Dispose() { Redis.Close(); } - public ConnectionMultiplexer Redis { get; private set; } + public ConnectionMultiplexer Redis { get; } } } \ No newline at end of file