using PkmnLib.Dynamic.Models; using PkmnLib.Dynamic.ScriptHandling.Registry; using PkmnLib.Plugin.Gen7.Scripts.Moves; using PsychicTerrainScript = PkmnLib.Plugin.Gen7.Scripts.Terrain.PsychicTerrain; namespace PkmnLib.Plugin.Gen7.Tests.Scripts.Moves; /// /// Tests for the move script. /// Gen VII Bulbapedia behavior: "Genesis Supernova deals damage and causes the battlefield to become /// Psychic Terrain for five turns." /// public class GenesisSupernovaTests { private static (GenesisSupernova script, IExecutingMove move, IBattle battle) CreateTestSetup() { var script = new GenesisSupernova(); var move = Substitute.For(); var battle = Substitute.For(); var user = Substitute.For(); move.User.Returns(user); user.Battle.Returns(battle); return (script, move, battle); } /// /// Bulbapedia: Genesis Supernova "causes the battlefield to become Psychic Terrain" — the move sets /// the battle's terrain to the terrain script. /// [Test] public void OnSecondaryEffect_SetsPsychicTerrainOnBattle() { // Arrange var (script, move, battle) = CreateTestSetup(); // Act script.OnSecondaryEffect(move, Substitute.For(), 0); // Assert battle.Received(1).SetTerrain(ScriptUtils.ResolveName()); } }