quantum-space-buddies/QSBTests/PatchTests.cs
Mister_Nebula 2024e5fcd9 cleanup
2021-10-15 21:08:17 +01:00

37 lines
919 B
C#

using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace QSBTests
{
[TestClass]
public class PatchTests
{
//[TestMethod]
//public void CheckUnreferencedPatches()
//{
// var qsbAssembly = Assembly.Load("QSB");
// var allPatchTypes = qsbAssembly
// .GetTypes()
// .Where(x => typeof(QSBPatch).IsAssignableFrom(x) && !x.IsInterface && !x.IsAbstract);
// QSBPatchManager.Init();
// var patchInstances = (List<QSBPatch>)typeof(QSBPatchManager)
// .GetField("_patchList", BindingFlags.NonPublic | BindingFlags.Static)
// .GetValue(typeof(QSBPatchManager));
// var failedTypes = new List<Type>();
// foreach (var type in allPatchTypes)
// {
// if (!patchInstances.Any(x => x.GetType() == type))
// {
// failedTypes.Add(type);
// }
// }
// if (failedTypes.Count > 0)
// {
// Assert.Fail(string.Join(", ", failedTypes.Select(x => x.Name)));
// }
//}
}
}