Many more things use the new reflection system

Project for Torch.Server tests.
Refactoring some of the torch utility classes into a different namespace.
This commit is contained in:
Westin Miller
2017-08-20 23:46:19 -07:00
parent 64eef6cd8e
commit 8d101c4c11
21 changed files with 549 additions and 213 deletions

35
Torch.Tests/TestUtils.cs Normal file
View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Torch.Utils;
namespace Torch.Tests
{
public sealed class TestUtils
{
public static void Init()
{
if (_torchResolver == null)
_torchResolver = new TorchAssemblyResolver(GetGameBinaries());
}
private static string GetGameBinaries()
{
string dir = Environment.CurrentDirectory;
while (!string.IsNullOrWhiteSpace(dir))
{
string gameBin = Path.Combine(dir, "GameBinaries");
if (Directory.Exists(gameBin))
return gameBin;
dir = Path.GetDirectoryName(dir);
}
throw new Exception("GetGameBinaries failed to find a folder named GameBinaries in the directory tree");
}
private static TorchAssemblyResolver _torchResolver;
}
}