using PkmnLib.Dynamic.Events; using PkmnLib.Dynamic.Libraries; using PkmnLib.Dynamic.Models; using PkmnLib.Dynamic.ScriptHandling; using PkmnLib.Plugin.Gen7.Scripts.Moves; using PkmnLib.Static; using PkmnLib.Static.Moves; using PkmnLib.Static.Utils; namespace PkmnLib.Plugin.Gen7.Tests.Scripts.Moves; /// /// Tests for the move script. /// Behavior is verified against the Bulbapedia page for Bug Bite. /// public class BugBiteTests { private const string BerryEffectName = "test_berry_effect"; /// /// Minimal that records whether its effect was applied through /// . /// private class RecordingItemScript : ItemScript { public RecordingItemScript(IItem item) : base(item) { } public bool WasUsed { get; private set; } /// public override bool IsItemUsable => true; /// public override void OnUse(EventHook eventHook) => WasUsed = true; } /// /// Creates a fully mocked test setup for BugBite tests. The battle's is a /// real resolver with a single registered item script constructor for , so /// eating a Berry runs a that the test can inspect. /// private static (BugBite bugBite, IExecutingMove move, IPokemon target, IHitData hitData, List createdItemScripts) CreateTestSetup(IItem? targetHeldItem, bool canSteal = true) { var bugBite = new BugBite(); var createdItemScripts = new List(); var resolver = new ScriptResolver(new Dictionary<(ScriptCategory, StringKey), Func