Machine.Specifications.ExceptionResult.FilterStackTrace C# (CSharp) Method

FilterStackTrace() static private method

Filters the stack trace to remove all lines that occur within the testing framework.
static private FilterStackTrace ( string stackTrace ) : string
stackTrace string The original stack trace
return string
    static string FilterStackTrace(string stackTrace)
    {
      if (stackTrace == null)
        return null;

      var lines = stackTrace
        .Split(new[] {Environment.NewLine}, StringSplitOptions.None)
        .Where(line => !IsFrameworkStackFrame(line))
        .ToArray();

      return string.Join(Environment.NewLine, lines);
    }