mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 08:52:50 +08:00

Since Spectre.Console targets .NET Standard 2.0 it makes sense to also run tests on .NET Framework (Windows only) This makes two tests fail: `Should_Write_Exception_With_Inner_Exception` and `Should_Write_Exceptions_With_Generic_Type_Parameters_In_Callsite_As_Expected`. Received (inner exception not handled): ``` System.InvalidOperationException: Something threw!System.InvalidOperationException: Throwing! at Spectre.Console.Tests.Data.TestExceptions.MethodThatThrows(Nullable`1 number) in /xyz/Exceptions.cs:nn at Spectre.Console.Tests.Data.TestExceptions.ThrowWithInnerException() in /xyz/Exceptions.cs:nn ``` Verified: ``` System.InvalidOperationException: Something threw! System.InvalidOperationException: Throwing! at Spectre.Console.Tests.Data.TestExceptions.MethodThatThrows(Nullable`1 number) in /xyz/Exceptions.cs:nn at Spectre.Console.Tests.Data.TestExceptions.ThrowWithInnerException() in /xyz/Exceptions.cs:nn at Spectre.Console.Tests.Data.TestExceptions.ThrowWithInnerException() in /xyz/Exceptions.cs:nn at Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_Exception_With_Inner_Exception>b__3_0() in /xyz/ExceptionTests.cs:nn at Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:nn ```
26 lines
553 B
C#
26 lines
553 B
C#
using System.Runtime.CompilerServices;
|
|
using Spectre.Verify.Extensions;
|
|
using VerifyTests;
|
|
|
|
namespace Spectre.Console.Tests
|
|
{
|
|
public static class VerifyConfiguration
|
|
{
|
|
[ModuleInitializer]
|
|
public static void Init()
|
|
{
|
|
VerifierSettings.DerivePathInfo(Expectations.Initialize);
|
|
}
|
|
}
|
|
}
|
|
|
|
#if !NET5_0_OR_GREATER
|
|
namespace System.Runtime.CompilerServices
|
|
{
|
|
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
|
|
public sealed class ModuleInitializerAttribute : Attribute
|
|
{
|
|
}
|
|
}
|
|
#endif
|