Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
pinzart90 committed Jan 10, 2024
1 parent 9ebd4b0 commit eaebcca
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 53 deletions.
18 changes: 0 additions & 18 deletions test/DynamoCoreWpfTests/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,9 @@ public class Setup
{
private AssemblyHelper assemblyHelper;

private void CurrentDispatcher_UnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
e.Handled = true;
System.Console.WriteLine($"PID {Process.GetCurrentProcess().Id} Unhandled exception thrown during test {TestContext.CurrentContext.Test.Name} with message : {e.Exception.Message + Environment.NewLine + e.Exception.StackTrace}");
}

private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
var ex = e.ExceptionObject as Exception;
System.Console.WriteLine($"PID {Process.GetCurrentProcess().Id} Unhandled exception thrown during test {TestContext.CurrentContext.Test.Name} with message : {ex.Message + Environment.NewLine + ex.StackTrace}");
}

[OneTimeSetUp]
public void RunBeforeAllTests()
{
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Dispatcher.CurrentDispatcher.UnhandledException += CurrentDispatcher_UnhandledException;

var dispatcher = Dispatcher.CurrentDispatcher;
Assert.IsNotNull(dispatcher);

Expand All @@ -54,8 +39,5 @@ public void RunAfterAllTests()
AppDomain.CurrentDomain.AssemblyResolve -= assemblyHelper.ResolveAssembly;
assemblyHelper = null;
Dispatcher.CurrentDispatcher.InvokeShutdown();

AppDomain.CurrentDomain.UnhandledException -= CurrentDomain_UnhandledException;
Dispatcher.CurrentDispatcher.UnhandledException -= CurrentDispatcher_UnhandledException;
}
}
18 changes: 0 additions & 18 deletions test/ViewExtensionLibraryTests/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,9 @@ public class Setup
{
private AssemblyHelper assemblyHelper;

private void CurrentDispatcher_UnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
e.Handled = true;
System.Console.WriteLine($"PID {Process.GetCurrentProcess().Id} Unhandled exception thrown during test {TestContext.CurrentContext.Test.Name} with message : {e.Exception.Message + Environment.NewLine + e.Exception.StackTrace}");
}

private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
var ex = e.ExceptionObject as Exception;
System.Console.WriteLine($"PID {Process.GetCurrentProcess().Id} Unhandled exception thrown during test {TestContext.CurrentContext.Test.Name} with message : {ex.Message + Environment.NewLine + ex.StackTrace}");
}

[OneTimeSetUp]
public void SetUp()
{
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Dispatcher.CurrentDispatcher.UnhandledException += CurrentDispatcher_UnhandledException;

var assemblyPath = Assembly.GetExecutingAssembly().Location;
var moduleRootFolder = new DirectoryInfo(assemblyPath).Parent;

Expand All @@ -50,8 +35,5 @@ public void TearDown()
{
AppDomain.CurrentDomain.AssemblyResolve -= assemblyHelper.ResolveAssembly;
assemblyHelper = null;

AppDomain.CurrentDomain.UnhandledException -= CurrentDomain_UnhandledException;
Dispatcher.CurrentDispatcher.UnhandledException -= CurrentDispatcher_UnhandledException;
}
}
17 changes: 0 additions & 17 deletions test/VisualizationTests/Setups.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,9 @@ public class Setup
{
private AssemblyHelper assemblyHelper;

private void CurrentDispatcher_UnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
e.Handled = true;
System.Console.WriteLine($"PID {Process.GetCurrentProcess().Id} Unhandled exception thrown during test {TestContext.CurrentContext.Test.Name} with message : {e.Exception.Message + Environment.NewLine + e.Exception.StackTrace}");
}

private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
var ex = e.ExceptionObject as Exception;
System.Console.WriteLine($"PID {Process.GetCurrentProcess().Id} Unhandled exception thrown during test {TestContext.CurrentContext.Test.Name} with message : {ex.Message + Environment.NewLine + ex.StackTrace}");
}

[OneTimeSetUp]
public void RunBeforeAllTests()
{
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Dispatcher.CurrentDispatcher.UnhandledException += CurrentDispatcher_UnhandledException;

var assemblyPath = Assembly.GetExecutingAssembly().Location;
var moduleRootFolder = new DirectoryInfo(assemblyPath).Parent;

Expand All @@ -48,7 +33,5 @@ public void RunAfterAllTests()
{
AppDomain.CurrentDomain.AssemblyResolve -= assemblyHelper.ResolveAssembly;
assemblyHelper = null;
AppDomain.CurrentDomain.UnhandledException -= CurrentDomain_UnhandledException;
Dispatcher.CurrentDispatcher.UnhandledException -= CurrentDispatcher_UnhandledException;
}
}

0 comments on commit eaebcca

Please sign in to comment.