1 changed files with 28 additions and 0 deletions
@ -0,0 +1,28 @@ |
|||
using System; |
|||
using System.Diagnostics; |
|||
using System.Runtime.CompilerServices; |
|||
|
|||
namespace Avalonia.Base.UnitTests |
|||
{ |
|||
internal static class ModuleInitializer |
|||
{ |
|||
[ModuleInitializer] |
|||
internal static void TestInit() |
|||
{ |
|||
Trace.Listeners.Insert(0, new ThrowListener()); |
|||
} |
|||
|
|||
private class ThrowListener : TextWriterTraceListener |
|||
{ |
|||
public override void Fail(string message) |
|||
{ |
|||
throw new Exception("Assertion Failed. " + message); |
|||
} |
|||
|
|||
public override void Fail(string message, string detailMessage) |
|||
{ |
|||
throw new Exception("Assertion Failed. " + message + detailMessage); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue