Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -17,12 +17,12 @@ public class IncinerateTests
|
||||
/// Creates a fully mocked test setup for Incinerate tests, with the target holding the given item
|
||||
/// (nothing when null).
|
||||
/// </summary>
|
||||
private static (Incinerate script, IExecutingMove move, IPokemon target, IHitData hitData, EventHook eventHook)
|
||||
CreateTestSetup(IItem? heldItem)
|
||||
private static (Incinerate script, IExecutingMove move, IBattlePokemon target, IHitData hitData, EventHook eventHook
|
||||
) CreateTestSetup(IItem? heldItem)
|
||||
{
|
||||
var script = new Incinerate();
|
||||
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);
|
||||
|
||||
@@ -58,7 +58,7 @@ public class IncinerateTests
|
||||
/// <summary>
|
||||
/// Helper to check whether the target's held item was taken away.
|
||||
/// </summary>
|
||||
private static bool ItemWasRemoved(IPokemon pokemon) =>
|
||||
private static bool ItemWasRemoved(IBattlePokemon pokemon) =>
|
||||
pokemon.ReceivedCalls().Any(c => c.GetMethodInfo().Name == "TryStealHeldItem");
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user