Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -13,14 +13,14 @@ public class KnockOffTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a fully mocked test setup for Knock Off tests. When <paramref name="targetHasItem"/> is true,
|
||||
/// <see cref="IPokemon.TryStealHeldItem"/> succeeds and yields a mocked item.
|
||||
/// <see cref="IBattlePokemon.TryStealHeldItem"/> succeeds and yields a mocked item.
|
||||
/// </summary>
|
||||
private static (KnockOff script, IExecutingMove move, IPokemon target, IPokemon user, IHitData hitData)
|
||||
private static (KnockOff script, IExecutingMove move, IBattlePokemon target, IBattlePokemon user, IHitData hitData)
|
||||
CreateTestSetup(bool targetHasItem)
|
||||
{
|
||||
var script = new KnockOff();
|
||||
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);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class KnockOffTests
|
||||
return targetHasItem;
|
||||
});
|
||||
|
||||
var user = Substitute.For<IPokemon>();
|
||||
var user = Substitute.For<IBattlePokemon>();
|
||||
move.User.Returns(user);
|
||||
|
||||
return (script, move, target, user, hitData);
|
||||
|
||||
Reference in New Issue
Block a user