Adds optional way to set damage randomness on or off on individual integration tests.
All checks were successful
Build / Build (push) Successful in 49s
All checks were successful
Build / Build (push) Successful in 49s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user