More unit tests, more fixes

This commit is contained in:
2026-07-05 19:02:00 +02:00
parent 6a82c20cf2
commit 94ddf63861
16 changed files with 1994 additions and 6 deletions

View File

@@ -0,0 +1,52 @@
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();
}
}