Adds optional way to set damage randomness on or off on individual integration tests.
Build / Build (push) Successful in 49s

This commit is contained in:
Deukhoofd committed 2025-05-19 16:10:05 +02:00
1 parent 405a21e887
commit 2680aeff80
6 files changed
+34 -13

No files matched your search

@@ -31,15 +31,31 @@ public class IntegrationTestRunner
}
}
private static IDynamicLibrary? _libraryWithRandomness;
private static IDynamicLibrary? _libraryWithoutRandomness;
[Test, MethodDataSource(nameof(TestCases))]
public async Task RunIntegrationTest(IntegrationTestModel test)
{
var library = DynamicLibraryImpl.Create([
new Gen7Plugin(new Gen7PluginConfiguration
{
DamageCalculatorHasRandomness = true,
}),
]);
IDynamicLibrary library;
if (test.BattleSetup.HasDamageRandomness)
{
library = _libraryWithRandomness ??= DynamicLibraryImpl.Create([
new Gen7Plugin(new Gen7PluginConfiguration
{
DamageCalculatorHasRandomness = true,
}),
]);
}
else
{
library = _libraryWithoutRandomness ??= DynamicLibraryImpl.Create([
new Gen7Plugin(new Gen7PluginConfiguration
{
DamageCalculatorHasRandomness = false,
}),
]);
}
await TestContext.Current!.OutputWriter.WriteLineAsync("File: " + $"file://{test.FileName}");
TestContext.Current.AddArtifact(new Artifact