PKHeX/Tests/PKHeX.Core.Tests/Util/TestUtil.cs
Kurt a45a7cc2d3 Misc fixes
Pokewalker: defer match if shiny
Jacq egg: recognize unhatched egg, traded
sv-pokedex-old: don't add rows for >1010 species (out of range)
static9: correctly flag scale mismatch

SAV4HGSS: expose pokegear #'s as span instead of alloc
2023-09-21 13:14:34 -07:00

33 lines
782 B
C#

using System;
using System.IO;
namespace PKHeX.Core.Tests;
internal static class TestUtil
{
public static string GetRepoPath()
{
var folder = Directory.GetCurrentDirectory();
while (!folder.EndsWith(nameof(Tests)))
{
var dir = Directory.GetParent(folder);
ArgumentNullException.ThrowIfNull(dir);
folder = dir.FullName;
}
return folder;
}
private static readonly object InitLock = new();
private static bool IsInitialized;
public static void InitializeLegality()
{
lock (InitLock)
{
if (IsInitialized)
return;
RibbonStrings.ResetDictionary(GameInfo.Strings.ribbons);
IsInitialized = true;
}
}
}