Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -12,17 +12,17 @@ namespace PkmnLib.Plugin.Gen7.Tests.Scripts.Moves;
|
||||
/// </summary>
|
||||
public class BestowTests
|
||||
{
|
||||
private static (Bestow script, IExecutingMove move, IPokemon user, IPokemon target, IHitData hitData)
|
||||
private static (Bestow script, IExecutingMove move, IBattlePokemon user, IBattlePokemon target, IHitData hitData)
|
||||
CreateTestSetup(IItem? userItem, IItem? targetItem)
|
||||
{
|
||||
var script = new Bestow();
|
||||
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);
|
||||
target.HeldItem.Returns(targetItem);
|
||||
|
||||
var user = Substitute.For<IPokemon>();
|
||||
var user = Substitute.For<IBattlePokemon>();
|
||||
user.HeldItem.Returns(userItem);
|
||||
user.RemoveHeldItemForBattle().Returns(userItem);
|
||||
move.User.Returns(user);
|
||||
@@ -68,7 +68,7 @@ public class BestowTests
|
||||
|
||||
/// <summary>
|
||||
/// Bulbapedia: "Items given away in Trainer battles return to the original Pokémon after the battle."
|
||||
/// The item is taken from the user through <see cref="IPokemon.RemoveHeldItemForBattle"/>, which only
|
||||
/// The item is taken from the user through <see cref="IBattlePokemon.RemoveHeldItemForBattle"/>, which only
|
||||
/// removes the item for the duration of the battle.
|
||||
/// </summary>
|
||||
[Test]
|
||||
|
||||
Reference in New Issue
Block a user