Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -14,12 +14,12 @@ namespace PkmnLib.Plugin.Gen7.Tests.Scripts.Moves;
|
||||
/// </summary>
|
||||
public class MementoTests
|
||||
{
|
||||
private static (Memento script, IExecutingMove move, IPokemon target, IPokemon user) CreateTestSetup()
|
||||
private static (Memento script, IExecutingMove move, IBattlePokemon target, IBattlePokemon user) CreateTestSetup()
|
||||
{
|
||||
var script = new Memento();
|
||||
var move = Substitute.For<IExecutingMove>();
|
||||
var target = Substitute.For<IPokemon>();
|
||||
var user = Substitute.For<IPokemon>();
|
||||
var target = Substitute.For<IBattlePokemon>();
|
||||
var user = Substitute.For<IBattlePokemon>();
|
||||
move.User.Returns(user);
|
||||
return (script, move, target, user);
|
||||
}
|
||||
@@ -30,7 +30,7 @@ public class MementoTests
|
||||
/// argument matchers because the trailing <see cref="EventBatchId"/> parameter cannot be bound by
|
||||
/// <c>Arg.Any</c>.
|
||||
/// </summary>
|
||||
private static object?[]? GetStatBoostArgs(IPokemon pokemon, Statistic stat) =>
|
||||
private static object?[]? GetStatBoostArgs(IBattlePokemon pokemon, Statistic stat) =>
|
||||
pokemon.ReceivedCalls().Where(c => c.GetMethodInfo().Name == "ChangeStatBoost").Select(c => c.GetArguments())
|
||||
.FirstOrDefault(args => (Statistic)args[0]! == stat);
|
||||
|
||||
@@ -119,7 +119,7 @@ public class MementoTests
|
||||
/// <summary>
|
||||
/// Bulbapedia (Generation V onward): "the user faints if it successfully hits but cannot lower stats due
|
||||
/// to abilities like Clear Body or stats already at -6."
|
||||
/// A substitute's <see cref="IPokemon.ChangeStatBoost"/> returns false by default (the stat drops were
|
||||
/// A substitute's <see cref="IBattlePokemon.ChangeStatBoost"/> returns false by default (the stat drops were
|
||||
/// prevented), but the user must still faint.
|
||||
/// </summary>
|
||||
[Test]
|
||||
|
||||
Reference in New Issue
Block a user