Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -21,12 +21,12 @@ public class MiracleEyeTests
|
||||
/// Creates a fully mocked test setup for Miracle Eye tests, with the target at the given evasion
|
||||
/// stat stage.
|
||||
/// </summary>
|
||||
private static (MiracleEye script, IExecutingMove move, IPokemon target, IScriptSet volatileSet, IHitData hitData)
|
||||
CreateTestSetup(sbyte evasionStage = 0)
|
||||
private static (MiracleEye script, IExecutingMove move, IBattlePokemon target, IScriptSet volatileSet, IHitData
|
||||
hitData) CreateTestSetup(sbyte evasionStage = 0)
|
||||
{
|
||||
var script = new MiracleEye();
|
||||
var move = Substitute.For<IExecutingMove>();
|
||||
var target = Substitute.For<IPokemon>();
|
||||
var target = Substitute.For<IBattlePokemon>();
|
||||
var hitData = Substitute.For<IHitData>();
|
||||
move.GetHitData(target, 0).Returns(hitData);
|
||||
|
||||
@@ -42,9 +42,9 @@ public class MiracleEyeTests
|
||||
|
||||
/// <summary>
|
||||
/// Helper to extract all stat boost changes requested on the target through
|
||||
/// <see cref="IPokemon.ChangeStatBoost"/>.
|
||||
/// <see cref="IBattlePokemon.ChangeStatBoost"/>.
|
||||
/// </summary>
|
||||
private static IReadOnlyList<(Statistic stat, sbyte amount)> GetStatBoostChanges(IPokemon target) =>
|
||||
private static IReadOnlyList<(Statistic stat, sbyte amount)> GetStatBoostChanges(IBattlePokemon target) =>
|
||||
target.ReceivedCalls().Where(c => c.GetMethodInfo().Name == "ChangeStatBoost")
|
||||
.Select(c => ((Statistic)c.GetArguments()[0]!, (sbyte)c.GetArguments()[1]!)).ToList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user