public void Should_raise_the_exception_on_the_calling_thread() { var exception = new CrazyTestOnlyException(); var task = dispatcher.Invoke(x => { throw exception; }); try { task.Wait(); } catch (AggregateException aggregateException) { aggregateException.InnerException.ShouldBeTheSameAs(exception); } }
public void Should_raise_the_exception_on_the_calling_thread() { var exception = new CrazyTestOnlyException(); var task = dispatcher.InvokeAsync(x => { throw exception; }); try { task.Wait(); } catch (AggregateException aggregateException) { aggregateException.InnerException.ShouldBeTheSameAs(exception); } }