mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-06 05:18:26 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
using System;
|
|
|
|
namespace Sandbox.CodeUpgrader;
|
|
|
|
[TestClass]
|
|
public partial class UpgraderTests
|
|
{
|
|
async Task TestAnalyzer<T>() where T : Analyzer, new()
|
|
{
|
|
var t = new T();
|
|
await t.RunTests( new AnalyzerTest<T>() );
|
|
}
|
|
|
|
async Task TestFixer<T>() 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<BroadcastAttributeAnalyzer>();
|
|
[TestMethod] public Task BroadcastAttributeFix() => TestFixer<BroadcastAttributeFix>();
|
|
|
|
[TestMethod] public Task AuthorityAttributeAnalyzer() => TestAnalyzer<AuthorityAttributeAnalyzer>();
|
|
[TestMethod] public Task AuthorityAttributeFix() => TestFixer<AuthorityAttributeFix>();
|
|
|
|
[TestMethod] public Task GpuBufferAnalyzer() => TestAnalyzer<GpuBufferAnalyzer>();
|
|
[TestMethod] public Task GpuBufferFix() => TestFixer<GpuBufferFix>();
|
|
|
|
[TestMethod] public Task ConCmdAttributeAnalyzer() => TestAnalyzer<ConCmdAnalyzer>();
|
|
[TestMethod] public Task ConCmdAttributeFix() => TestFixer<ConCmdAttributeFix>();
|
|
|
|
[TestMethod] public Task ConVarAttributeAnalyzer() => TestAnalyzer<ConVarAnalyzer>();
|
|
[TestMethod] public Task ConVarAttributeFix() => TestFixer<ConVarAttributeFix>();
|
|
|
|
[TestMethod] public Task HotloadUnsupportedAnalyzer() => TestAnalyzer<HotloadUnsupportedAnalyzer>();
|
|
[TestMethod] public Task HotloadUnsupportedFix() => TestFixer<HotloadUnsupportedFixer>();
|
|
}
|