Deukhoofd c795f20e54
All checks were successful
Build / Build (push) Successful in 51s
Implement highest damage AI, further work on AI runner, random fixes
2025-07-05 14:56:25 +02:00

21 lines
717 B
C#

using PkmnLib.Dynamic.ScriptHandling;
using PkmnLib.Dynamic.ScriptHandling.Registry;
using Assembly = System.Reflection.Assembly;
namespace PkmnLib.Plugin.Gen7.Tests.Scripts;
public class GenericScriptTests
{
[Test]
public async Task EveryScriptHasAttribute()
{
var scripts = typeof(Gen7Plugin).Assembly.GetTypes()
.Where(t => t.IsSubclassOf(typeof(Script)) && !t.IsAbstract);
foreach (var script in scripts)
{
var attributes = script.GetCustomAttributes(typeof(ScriptAttribute), false);
await Assert.That(attributes).IsNotEmpty().Because(
$"Script {script.Name} does not have the Script attribute defined.");
}
}
}