using PkmnLib.Dynamic.Models;
using PkmnLib.Plugin.Gen7.Scripts.Moves;
namespace PkmnLib.Plugin.Gen7.Tests.Scripts.Moves;
///
/// Tests for the move script.
/// Gen VII Bulbapedia behavior: "Gastro Acid suppresses the target's Ability while it remains in battle."
///
///
/// Bulbapedia also lists Abilities the move fails against (Multitype, Stance Change, ...); that check is
/// implemented engine-side through inside
/// , so it is not the responsibility of this script.
///
public class GastroAcidTests
{
///
/// Bulbapedia: "Gastro Acid suppresses the target's Ability while it remains in battle."
/// The script requests the suppression on the target.
///
[Test]
public async Task OnSecondaryEffect_Always_SuppressesTargetAbility()
{
// Arrange
var script = new GastroAcid();
var move = Substitute.For();
var target = Substitute.For();
// Act
script.OnSecondaryEffect(move, target, 0);
// Assert
target.Received(1).SuppressAbility();
await Assert.That(target.ReceivedCalls().Any(c => c.GetMethodInfo().Name == "SuppressAbility")).IsTrue();
}
///
/// Bulbapedia: the suppression applies to "the target's Ability" — the user's own Ability is left
/// untouched.
///
[Test]
public async Task OnSecondaryEffect_Always_DoesNotSuppressUserAbility()
{
// Arrange
var script = new GastroAcid();
var move = Substitute.For();
var user = Substitute.For();
move.User.Returns(user);
var target = Substitute.For();
// Act
script.OnSecondaryEffect(move, target, 0);
// Assert
await Assert.That(user.ReceivedCalls().Any(c => c.GetMethodInfo().Name == "SuppressAbility")).IsFalse();
}
}