Commit 81aa67e5 authored by Nick Craver's avatar Nick Craver

Tests: more cleanup

parent 70d38a60
......@@ -8,14 +8,7 @@ public class Expiry : TestBase
{
public Expiry(ITestOutputHelper output) : base (output) { }
private static string[] GetMap(bool disablePTimes)
{
if (disablePTimes)
{
return new[] { "pexpire", "pexpireat", "pttl" };
}
return null;
}
private static string[] GetMap(bool disablePTimes) => disablePTimes ? (new[] { "pexpire", "pexpireat", "pttl" }) : null;
[Theory]
[InlineData(true)]
......
......@@ -122,7 +122,7 @@ public void HashIncrDecrFloatingPoint()
}
var val = (double)db.HashGet(key, field);
Assert.True(Within(sum, val, 0.0001));
Assert.True(Within(sum, val, 0.0001), $"{sum} not within 0.0001 of {val}");
}
}
......
using System;
using System.Net;
using System.Threading;
using StackExchange.Redis.Tests.Helpers;
using Xunit;
using Xunit.Abstractions;
......@@ -12,11 +13,13 @@ public class Sentinel
private ConnectionMultiplexer Conn { get; }
private IServer Server { get; }
protected TextWriterOutputHelper Writer { get; }
public ITestOutputHelper Output { get; }
public Sentinel(ITestOutputHelper output)
{
Output = output;
Writer = new TextWriterOutputHelper(output);
Skip.IfNoConfig(nameof(TestConfig.Config.SentinelServer), TestConfig.Current.SentinelServer);
Skip.IfNoConfig(nameof(TestConfig.Config.SentinelSeviceName), TestConfig.Current.SentinelSeviceName);
......@@ -30,7 +33,7 @@ public Sentinel(ITestOutputHelper output)
ServiceName = TestConfig.Current.SentinelSeviceName,
SyncTimeout = 5000
};
Conn = ConnectionMultiplexer.Connect(options, Console.Out);
Conn = ConnectionMultiplexer.Connect(options, Writer);
Thread.Sleep(3000);
Assert.True(Conn.IsConnected);
Server = Conn.GetServer(TestConfig.Current.SentinelServer, TestConfig.Current.SentinelPort);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment