Skip to content

Commit

Permalink
Minor clarification by moving initialization to constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
haysch committed Aug 10, 2023
1 parent 36b55fe commit e6c606f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/NRedisStack.Tests/RedisFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}

0 comments on commit e6c606f

Please sign in to comment.