public void Default()
 {
     var e = new Exception();
     var worker = Substitute.For<IWorkerBase>();
     var test = new WorkerErrorEventArgs(worker, e);
     Assert.Equal(worker, test.Worker);
     Assert.Equal(e, test.Error);
 }
        public void Default()
        {
            var e      = new Exception();
            var worker = Substitute.For <IWorkerBase>();
            var test   = new WorkerErrorEventArgs(worker, e);

            Assert.Equal(worker, test.Worker);
            Assert.Equal(e, test.Error);
        }
Example #3
0
 /// <summary>
 /// Raises the user exception.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="WorkerErrorEventArgs"/> instance containing the event data.</param>
 protected void RaiseUserException(object sender, WorkerErrorEventArgs e)
 {
     UserException?.Invoke(sender, e);
 }
Example #4
0
 private void BackgroundWorkerHelper_WorkerError(object sender, WorkerErrorEventArgs e)
 {
     HelperFactory.MessageHelper.ShowMessageError(MVPCommonMessages.Common_CaptionError, "The operation was aborted by an error", e.Error);
 }
Example #5
0
 /// <summary>
 /// Logs the user exception.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="WorkerErrorEventArgs"/> instance containing the event data.</param>
 protected void LogUserException(object sender, WorkerErrorEventArgs e)
 {
     Log.WarnException("User exception", e.Error);
 }
Example #6
0
 /// <summary>
 /// Logs the system exception.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="WorkerErrorEventArgs"/> instance containing the event data.</param>
 protected void LogSystemException(object sender, WorkerErrorEventArgs e)
 {
     Log.ErrorException("Unhanded system exception", e.Error);
 }
 /// <summary>
 /// Raises the system exception.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="WorkerErrorEventArgs"/> instance containing the event data.</param>
 private void RaiseSystemException(object sender, WorkerErrorEventArgs e)
 {
     SystemException?.Invoke(sender, e);
 }