static void Main(String[] args) { try { // If using forms etc. add the event handler for handling UI thread exceptions to the event. // Application.ThreadException += new ThreadExceptionEventHandler(ErrorHandlerForm.Form1_UIThreadException); // Set the unhandled exception mode to force all Windows Forms errors to go through our handler. // Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); // Add the event handler for handling non-UI thread exceptions to the event. AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); int choice = 0; do { ShutdownTestRunner shutdown = null; shutdown = new ShutdownTestRunner(); choice = Menu(); if (choice > 0) { String channelType = queueOrStack(); shutdown.Init(channelType); } switch (choice) { case 1: Console.WriteLine("Press ENTER to complete the Menu test for Shutdown"); Console.ReadLine(); break; case 3: TEST = true; shutdown._03_shutdown(); Console.WriteLine("Press ENTER to QUIT the shutdown component"); Console.ReadLine(); choice = 1; break; default: Console.WriteLine("No valid test selection was made. Shutting down..."); break; } }while (choice > 1); } catch (Exception ex) { // Ignore ex - We should have displayed it in the individual TEST that failed Console.Write(ex); } }
static void Main(String[] args) { try { // If using forms etc. add the event handler for handling UI thread exceptions to the event. // Application.ThreadException += new ThreadExceptionEventHandler(ErrorHandlerForm.Form1_UIThreadException); // Set the unhandled exception mode to force all Windows Forms errors to go through our handler. // Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); // Add the event handler for handling non-UI thread exceptions to the event. AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); int choice = 0; do { ShutdownTestRunner shutdown = null; shutdown = new ShutdownTestRunner(); choice = Menu(); if (choice > 0) { String channelType = queueOrStack(); int numberOftrials = numberOfTrials(); shutdown.Init(channelType, numberOftrials); } switch (choice) { case 1: Console.WriteLine("Press ENTER to complete the Menu test for Shutdown"); Console.ReadLine(); break; case 3: TEST = true; shutdown._03_shutdown(); Console.WriteLine("Press ENTER to EXIT the shutdown component"); Console.ReadLine(); break; default: Console.WriteLine("No valid test selection was made. Shutting down..."); break; } } while (choice > 1); } catch (Exception ex) { // Ignore ex - We should have displayed it in the individual TEST that failed Console.Write(ex); } }