Commit 19f2c868 authored by Nick Craver's avatar Nick Craver

More info in test output

Trying to figure out socket failure discrepancies on Appveyor.
parent 49ca4d8a
using System;
using StackExchange.Redis.Tests.Helpers;
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Xunit;
......@@ -9,7 +10,11 @@ namespace StackExchange.Redis.Tests.Booksleeve
public class BookSleeveTestBase
{
public ITestOutputHelper Output { get; }
public BookSleeveTestBase(ITestOutputHelper output) => Output = output;
public BookSleeveTestBase(ITestOutputHelper output)
{
Output = output;
Output.WriteFrameworkVersion();
}
static BookSleeveTestBase()
{
......
......@@ -54,7 +54,7 @@ public void CanNotOpenNonsenseConnection_IP()
[Fact]
public async Task CanNotOpenNonsenseConnection_DNS()
{
await Assert.ThrowsAsync<RedisConnectionException>(async () =>
var ex = await Assert.ThrowsAsync<RedisConnectionException>(async () =>
{
var log = new StringWriter();
try
......@@ -68,6 +68,7 @@ public async Task CanNotOpenNonsenseConnection_DNS()
Output.WriteLine(log.ToString());
}
}).ForAwait();
Output.WriteLine(ex.ToString());
}
[Fact]
......
using Xunit.Abstractions;
namespace StackExchange.Redis.Tests.Helpers
{
public static class Extensions
{
public static void WriteFrameworkVersion(this ITestOutputHelper output)
{
#if NET462
output.WriteLine("Compiled under .NET 4.6.2");
#elif NETCOREAPP1_0
output.WriteLine("Compiled under .NETCoreApp1.0");
#elif NETCOREAPP2_0
output.WriteLine("Compiled under .NETCoreApp2.0");
#else
output.WriteLine("Compiled under <unknown framework>");
#endif
}
}
}
......@@ -23,6 +23,7 @@ public abstract class TestBase : IDisposable
protected TestBase(ITestOutputHelper output)
{
Output = output;
Output.WriteFrameworkVersion();
Writer = new TextWriterOutputHelper(output);
socketManager = new SocketManager(GetType().Name);
ClearAmbientFailures();
......
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