Extensions.cs 625 B

12345678910111213141516171819202122232425
  1. using System.Collections.Generic;
  2. using Renci.SshNet.Common;
  3. namespace Renci.SshNet.Tests.Common
  4. {
  5. internal static class Extensions
  6. {
  7. public static string AsString(this IList<ExceptionEventArgs> exceptionEvents)
  8. {
  9. if (exceptionEvents.Count == 0)
  10. {
  11. return string.Empty;
  12. }
  13. var reportedExceptions = string.Empty;
  14. foreach (var exceptionEvent in exceptionEvents)
  15. {
  16. reportedExceptions += exceptionEvent.Exception.ToString();
  17. }
  18. return reportedExceptions;
  19. }
  20. }
  21. }