Rebus.TestHelpers/Extensions/HandlerExceptionExtensions.cs
/// <summary>
/// Throws Exception if the collection of <see cref="HandlerException"/> is not empty.
/// </summary>
/// <exception cref="AggregateException">Containing a list of exceptions inside <see cref="HandlerException"/></exception>
Throws Exception if the collection of  is not empty.
Throws Exception if the collection of is not empty .
public static void ThrowIfNotEmpty(this IEnumerable<HandlerException> exceptions)
    {
        if (exceptions == null) throw new ArgumentNullException(nameof(exceptions));
        var list = exceptions.ToList();
        if (!list.Any()) return;
        throw new AggregateException(list.Select(ex => ex.Exception));
    }
public static void ThrowIfNotEmpty ( this IEnumerable < HandlerException > exceptions ) { if ( exceptions == null ) throw new ArgumentNullException ( nameof ( exceptions ) ) ; var list = exceptions . ToList ( ) ; if ( ! list . Any ( ) ) return ; throw new AggregateException ( list . Select ( ex => ex . Exception ) ) ; }
Throws Exception if the collection of  is not empty.
Throws Exception if the collection of is not empty .
Containing a list of exceptions inside
Containing a list of exceptions inside
IEnumerable<HandlerException>
this