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

Tests: more cleanup

parent 70d38a60
...@@ -8,14 +8,7 @@ public class Expiry : TestBase ...@@ -8,14 +8,7 @@ public class Expiry : TestBase
{ {
public Expiry(ITestOutputHelper output) : base (output) { } public Expiry(ITestOutputHelper output) : base (output) { }
private static string[] GetMap(bool disablePTimes) private static string[] GetMap(bool disablePTimes) => disablePTimes ? (new[] { "pexpire", "pexpireat", "pttl" }) : null;
{
if (disablePTimes)
{
return new[] { "pexpire", "pexpireat", "pttl" };
}
return null;
}
[Theory] [Theory]
[InlineData(true)] [InlineData(true)]
......
...@@ -122,7 +122,7 @@ public void HashIncrDecrFloatingPoint() ...@@ -122,7 +122,7 @@ public void HashIncrDecrFloatingPoint()
} }
var val = (double)db.HashGet(key, field); 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;
using System.Net; using System.Net;
using System.Threading; using System.Threading;
using StackExchange.Redis.Tests.Helpers;
using Xunit; using Xunit;
using Xunit.Abstractions; using Xunit.Abstractions;
...@@ -12,11 +13,13 @@ public class Sentinel ...@@ -12,11 +13,13 @@ public class Sentinel
private ConnectionMultiplexer Conn { get; } private ConnectionMultiplexer Conn { get; }
private IServer Server { get; } private IServer Server { get; }
protected TextWriterOutputHelper Writer { get; }
public ITestOutputHelper Output { get; } public ITestOutputHelper Output { get; }
public Sentinel(ITestOutputHelper output) public Sentinel(ITestOutputHelper output)
{ {
Output = output; Output = output;
Writer = new TextWriterOutputHelper(output);
Skip.IfNoConfig(nameof(TestConfig.Config.SentinelServer), TestConfig.Current.SentinelServer); Skip.IfNoConfig(nameof(TestConfig.Config.SentinelServer), TestConfig.Current.SentinelServer);
Skip.IfNoConfig(nameof(TestConfig.Config.SentinelSeviceName), TestConfig.Current.SentinelSeviceName); Skip.IfNoConfig(nameof(TestConfig.Config.SentinelSeviceName), TestConfig.Current.SentinelSeviceName);
...@@ -30,7 +33,7 @@ public Sentinel(ITestOutputHelper output) ...@@ -30,7 +33,7 @@ public Sentinel(ITestOutputHelper output)
ServiceName = TestConfig.Current.SentinelSeviceName, ServiceName = TestConfig.Current.SentinelSeviceName,
SyncTimeout = 5000 SyncTimeout = 5000
}; };
Conn = ConnectionMultiplexer.Connect(options, Console.Out); Conn = ConnectionMultiplexer.Connect(options, Writer);
Thread.Sleep(3000); Thread.Sleep(3000);
Assert.True(Conn.IsConnected); Assert.True(Conn.IsConnected);
Server = Conn.GetServer(TestConfig.Current.SentinelServer, TestConfig.Current.SentinelPort); 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