mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-10 14:44:24 +00:00
3dc84d6a39
No longer need to disable correct-handler-state check for unit tests Adds indication for HT not matching gender (if active trainer is set)
33 lines
782 B
C#
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;
|
|
}
|
|
}
|
|
}
|