public DiagnosticBehavior(IRequestTrace trace, IDebugDetector detector, IOutputWriter writer, IExceptionHandlingObserver exceptionObserver) { _trace = trace; _detector = detector; _writer = writer; _exceptionObserver = exceptionObserver; }
protected override void beforeEach() { _insideBehavior = new DoNothingBehavior(); _exceptionHandler = MockFor <IExceptionHandler>(); _observer = MockFor <IExceptionHandlingObserver>(); ClassUnderTest.InsideBehavior = _insideBehavior; var testTask = new Task(() => ClassUnderTest.Invoke()); testTask.RunSynchronously(); }
protected override void beforeEach() { _argumentException = new ArgumentException("Failed"); _exceptionHandler = MockFor <IExceptionHandler>(); _observer = MockFor <IExceptionHandlingObserver>(); _exceptionHandler.Expect(x => x.ShouldHandle(_argumentException)).Return(false); ClassUnderTest.InsideBehavior = new AsyncThrowingBehavior(_argumentException); var testTask = new Task(() => ClassUnderTest.Invoke()); testTask.Start(); _exception = Assert.Throws <AggregateException>(testTask.Wait); }
public static void FinishProcessingTask(this Task task, IExceptionHandlingObserver observer) { if (task.IsFaulted) { var aggregateException = task.Exception.Flatten(); var allHandled = aggregateException.InnerExceptions.All(observer.WasObserved); if (!allHandled) { task.Wait(); } } }
public DiagnosticBehavior(IRequestTrace trace, IExceptionHandlingObserver exceptionObserver) { _trace = trace; _exceptionObserver = exceptionObserver; }
public AsyncInterceptExceptionBehavior(IEnumerable<IExceptionHandler> exceptionHandlers, IExceptionHandlingObserver exceptionHandlingObserver) { _exceptionHandlers = exceptionHandlers; _exceptionHandlingObserver = exceptionHandlingObserver; }
public AsyncInterceptExceptionBehavior(IEnumerable <IExceptionHandler> exceptionHandlers, IExceptionHandlingObserver exceptionHandlingObserver) { _exceptionHandlers = exceptionHandlers; _exceptionHandlingObserver = exceptionHandlingObserver; }
public BehaviorTracer(BehaviorCorrelation correlation, ILogger logger, IExceptionHandlingObserver exceptionObserver) { _correlation = correlation; _logger = logger; _exceptionObserver = exceptionObserver; }
public BehaviorTracer(BehaviorCorrelation correlation, IRequestTrace trace, IExceptionHandlingObserver exceptionObserver) { _correlation = correlation; _trace = trace; _exceptionObserver = exceptionObserver; }