NUnitUtils.cs 659 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using NUnit.Framework;
  6. namespace SharpGLTF
  7. {
  8. public static class NUnitUtils
  9. {
  10. public static string ToShortDisplayPath(this string path, int maxDirLength = 12)
  11. {
  12. var dir = System.IO.Path.GetDirectoryName(path);
  13. var fxt = System.IO.Path.GetFileName(path);
  14. if (dir.Length > maxDirLength)
  15. {
  16. dir = "..." + dir.Substring(dir.Length - maxDirLength);
  17. }
  18. return System.IO.Path.Combine(dir, fxt);
  19. }
  20. }
  21. }