PKHeX/Tests/PKHeX.Core.Tests/Util/TestUtil.cs
Kurt 3dc84d6a39 Revise ActiveTrainer checks if unset (unit tests)
No longer need to disable correct-handler-state check for unit tests
Adds indication for HT not matching gender (if active trainer is set)
2024-05-13 17:38:16 -05: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;
}
}
}