2020-11-14 16:20:48 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
2019-03-19 02:33:56 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
namespace PKHeX.Tests;
|
|
|
|
|
|
|
|
|
|
internal static class TestUtil
|
2019-03-19 02:33:56 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public static string GetRepoPath()
|
2019-03-19 02:33:56 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
var folder = Directory.GetCurrentDirectory();
|
|
|
|
|
while (!folder.EndsWith(nameof(Tests)))
|
2019-03-19 02:33:56 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
var dir = Directory.GetParent(folder);
|
|
|
|
|
if (dir == null)
|
|
|
|
|
throw new ArgumentNullException(nameof(dir));
|
|
|
|
|
folder = dir.FullName;
|
2019-03-19 02:33:56 +00:00
|
|
|
|
}
|
2022-06-18 18:04:24 +00:00
|
|
|
|
return folder;
|
2019-03-19 02:33:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|