using System; using Sandbox.CodeUpgrader; namespace CodeUpgraderTests; [TestClass] [DoNotParallelize] public partial class UpgraderTest { async Task TestAnalyzer() where T : Analyzer, new() { var t = new T(); await t.RunTests( new AnalyzerTest() ); } async Task TestFixer() where T : Fixer, new() { var t = new T(); var testType = typeof( FixerTest<,> ).MakeGenericType( t.Analyzer, t.GetType() ); var test = (IFixerTest)Activator.CreateInstance( testType ); await t.RunTests( test ); } [TestMethod] public Task BroadcastAttributeAnalyzer() => TestAnalyzer(); [TestMethod] public Task BroadcastAttributeFix() => TestFixer(); [TestMethod] public Task AuthorityAttributeAnalyzer() => TestAnalyzer(); [TestMethod] public Task AuthorityAttributeFix() => TestFixer(); [TestMethod] public Task GpuBufferAnalyzer() => TestAnalyzer(); [TestMethod] public Task GpuBufferFix() => TestFixer(); [TestMethod] public Task ConCmdAttributeAnalyzer() => TestAnalyzer(); [TestMethod] public Task ConCmdAttributeFix() => TestFixer(); [TestMethod] public Task ConVarAttributeAnalyzer() => TestAnalyzer(); [TestMethod] public Task ConVarAttributeFix() => TestFixer(); [TestMethod] public Task HotloadUnsupportedAnalyzer() => TestAnalyzer(); [TestMethod] public Task HotloadUnsupportedFix() => TestFixer(); [TestMethod] public Task SyncQueryAnalyzer() => TestAnalyzer(); [TestMethod] public Task SyncQueryFix() => TestFixer(); [TestMethod] public Task HostSyncAttributeAnalyzer() => TestAnalyzer(); [TestMethod] public Task HostSyncAttributeFix() => TestFixer(); }