mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
26 lines
641 B
C#
26 lines
641 B
C#
using System.IO;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
namespace BepInEx.Tests;
|
|
|
|
[TestClass]
|
|
public class AssemblyInit
|
|
{
|
|
private static string _testPath;
|
|
|
|
[AssemblyInitialize]
|
|
public static void InitAss(TestContext context)
|
|
{
|
|
_testPath = Path.Combine(Path.GetTempPath(), "BepinexTestDir");
|
|
Directory.CreateDirectory(_testPath);
|
|
|
|
var exePath = Path.Combine(_testPath, "Text.exe");
|
|
File.WriteAllBytes(exePath, new byte[] { });
|
|
|
|
Paths.SetExecutablePath(_testPath);
|
|
}
|
|
|
|
[AssemblyCleanup]
|
|
public static void CleanupAss() => Directory.Delete(_testPath, true);
|
|
}
|