public void ClientExceptionTest() { LoggingProvider <ClientLoggingHandler> .Log("Test", Category.Common); IOException e = new IOException("File Not Exist"); try { string result = string.Empty; string actual = string.Empty; ClientExceptionHandlerProvider.RepaireExceptionPolicies(); ExceptionHandlingResult exceptionHandlingResult = ExceptionManager.Instance.HandleException(e, "Policy1"); result = exceptionHandlingResult.Message; actual = "The process cannot access the file because it is being used by another process."; Assert.IsTrue(result == actual, "Exception error"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void ClientExceptionTest() { LoggingProvider <ClientLoggingHandler> .Log("Test", Category.Common); IOException e = new IOException("File Not Exist"); try { ClientExceptionHandlerProvider.RepaireExceptionPolicies(); ExceptionHandlingResult exceptionHandlingResult = ExceptionManager.Instance.HandleException(e, "Policy1"); Assert.AreEqual(exceptionHandlingResult.Message, "The process cannot access the file because it is being used by another process."); } catch (Exception ex) { } }
/// <summary> /// Initializes a new instance of the <see cref="App"/> class. /// </summary> public App() { System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-us"); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-us"); ClientExceptionHandlerProvider.RepaireExceptionPolicies(); this.Startup += this.Application_Startup; this.Exit += this.Application_Exit; this.UnhandledException += this.Application_UnhandledException; try { InitializeComponent(); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n--------------\r\n" + (ex.InnerException != null ? ex.InnerException.Message : "")); } }