<PackageReference Include="NUnit" Version="3.13.3" />

ExceptionHelper

public class ExceptionHelper
ExceptionHelper provides static methods for working with exceptions
public ExceptionHelper()

public static string BuildMessage(Exception exception, bool excludeExceptionNames = false)

Builds up a message, using the Message field of the specified exception as well as any InnerExceptions. Optionally excludes exception names, creating a more readable message.

public static string BuildStackTrace(Exception exception)

Builds up a message, using the Message field of the specified exception as well as any InnerExceptions.

public static void Rethrow(Exception exception)

Rethrows an exception, preserving its stack trace