using PkmnLib.Dynamic.Models;
using PkmnLib.Plugin.Gen7.Scripts.Moves;

namespace PkmnLib.Plugin.Gen7.Tests.Scripts.Moves;

/// <summary>
/// Tests for the <see cref="DarkestLariat"/> move script.
/// Gen VII Bulbapedia behavior: "Darkest Lariat inflicts damage, ignoring any changes to the target's
/// Defense and evasion stat stages."
/// </summary>
public class DarkestLariatTests
{
    /// <summary>
    /// Bulbapedia: "Darkest Lariat inflicts damage, ignoring any changes to the target's Defense [...]
    /// stat stages." The script bypasses the target's defensive stat boosts.
    /// </summary>
    [Test]
    public async Task BypassDefensiveStatBoosts_Always_SetsBypassToTrue()
    {
        // Arrange
        var script = new DarkestLariat();
        var move = Substitute.For<IExecutingMove>();
        var target = Substitute.For<IPokemon>();
        var bypass = false;

        // Act
        script.BypassDefensiveStatBoosts(move, target, 0, ref bypass);

        // Assert
        await Assert.That(bypass).IsTrue();
    }

    /// <summary>
    /// Bulbapedia: "Darkest Lariat inflicts damage, ignoring any changes to the target's [...] evasion
    /// stat stages." The script bypasses the target's evasion stat boosts.
    /// </summary>
    [Test]
    public async Task BypassEvasionStatBoosts_Always_SetsBypassToTrue()
    {
        // Arrange
        var script = new DarkestLariat();
        var move = Substitute.For<IExecutingMove>();
        var target = Substitute.For<IPokemon>();
        var bypass = false;

        // Act
        script.BypassEvasionStatBoosts(move, target, 0, ref bypass);

        // Assert
        await Assert.That(bypass).IsTrue();
    }
}