Skip to content

Commit 19f2c86

Browse files
committed
More info in test output
Trying to figure out socket failure discrepancies on Appveyor.
1 parent 49ca4d8 commit 19f2c86

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

StackExchange.Redis.Tests/Booksleeve/BookSleeveTestBase.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using StackExchange.Redis.Tests.Helpers;
2+
using System;
23
using System.Diagnostics;
34
using System.Threading.Tasks;
45
using Xunit;
@@ -9,7 +10,11 @@ namespace StackExchange.Redis.Tests.Booksleeve
910
public class BookSleeveTestBase
1011
{
1112
public ITestOutputHelper Output { get; }
12-
public BookSleeveTestBase(ITestOutputHelper output) => Output = output;
13+
public BookSleeveTestBase(ITestOutputHelper output)
14+
{
15+
Output = output;
16+
Output.WriteFrameworkVersion();
17+
}
1318

1419
static BookSleeveTestBase()
1520
{

StackExchange.Redis.Tests/Booksleeve/Config.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void CanNotOpenNonsenseConnection_IP()
5454
[Fact]
5555
public async Task CanNotOpenNonsenseConnection_DNS()
5656
{
57-
await Assert.ThrowsAsync<RedisConnectionException>(async () =>
57+
var ex = await Assert.ThrowsAsync<RedisConnectionException>(async () =>
5858
{
5959
var log = new StringWriter();
6060
try
@@ -68,6 +68,7 @@ await Assert.ThrowsAsync<RedisConnectionException>(async () =>
6868
Output.WriteLine(log.ToString());
6969
}
7070
}).ForAwait();
71+
Output.WriteLine(ex.ToString());
7172
}
7273

7374
[Fact]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Xunit.Abstractions;
2+
3+
namespace StackExchange.Redis.Tests.Helpers
4+
{
5+
public static class Extensions
6+
{
7+
public static void WriteFrameworkVersion(this ITestOutputHelper output)
8+
{
9+
#if NET462
10+
output.WriteLine("Compiled under .NET 4.6.2");
11+
#elif NETCOREAPP1_0
12+
output.WriteLine("Compiled under .NETCoreApp1.0");
13+
#elif NETCOREAPP2_0
14+
output.WriteLine("Compiled under .NETCoreApp2.0");
15+
#else
16+
output.WriteLine("Compiled under <unknown framework>");
17+
#endif
18+
}
19+
}
20+
}

StackExchange.Redis.Tests/TestBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public abstract class TestBase : IDisposable
2323
protected TestBase(ITestOutputHelper output)
2424
{
2525
Output = output;
26+
Output.WriteFrameworkVersion();
2627
Writer = new TextWriterOutputHelper(output);
2728
socketManager = new SocketManager(GetType().Name);
2829
ClearAmbientFailures();

0 commit comments

Comments
 (0)