Commit b987ab3f authored by Nick Craver's avatar Nick Craver

Tests: at least don't blow up immediately on Mono

parent e4ef33bd
using System.Runtime.InteropServices; using System;
using System.Runtime.InteropServices;
using Xunit.Abstractions; using Xunit.Abstractions;
namespace StackExchange.Redis.Tests.Helpers namespace StackExchange.Redis.Tests.Helpers
{ {
public static class Extensions public static class Extensions
{ {
public static void WriteFrameworkVersion(this ITestOutputHelper output) private static string VersionInfo { get; }
static Extensions()
{ {
#if NET462 #if NET462
output.WriteLine("Compiled under .NET 4.6.2"); VersionInfo = "Compiled under .NET 4.6.2";
#elif NETCOREAPP1_0 #elif NETCOREAPP1_0
output.WriteLine("Compiled under .NETCoreApp1.0"); VersionInfo = "Compiled under .NETCoreApp1.0";
#elif NETCOREAPP2_0 #elif NETCOREAPP2_0
output.WriteLine("Compiled under .NETCoreApp2.0"); VersionInfo = "Compiled under .NETCoreApp2.0";
#else #else
output.WriteLine("Compiled under <unknown framework>"); VersionInfo = "Compiled under <unknown framework>";
#endif #endif
output.WriteLine("Running on: " + RuntimeInformation.OSDescription); try
{
VersionInfo += "\nRunning on: " + RuntimeInformation.OSDescription;
}
catch (Exception)
{
VersionInfo += "\nFailed to get OS version";
}
} }
public static void WriteFrameworkVersion(this ITestOutputHelper output) => output.WriteLine(VersionInfo);
} }
} }
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