Fixes for unit tests
This commit is contained in:
@@ -24,7 +24,7 @@ public class AbilityDataTests
|
||||
}
|
||||
}
|
||||
|
||||
[Test, MethodDataSource(nameof(AllAbilitiesHaveValidScriptsData)), Explicit]
|
||||
[Test, MethodDataSource(nameof(AllAbilitiesHaveValidScriptsData))]
|
||||
public async Task AllAbilitiesEffectsHaveValidScripts(TestCaseData test)
|
||||
{
|
||||
var scriptName = test.Ability.Effect;
|
||||
@@ -39,7 +39,7 @@ public class AbilityDataTests
|
||||
catch (Exception e)
|
||||
{
|
||||
// Helper method to find the line number of the effect in the JSON file
|
||||
var file = Path.GetFullPath("../../../../Plugins/PkmnLib.Plugin.Gen7/Data/Abilities.json");
|
||||
var file = Path.GetFullPath("../../../../Plugins/PkmnLib.Plugin.Gen7/Data/Abilities.jsonc");
|
||||
var json = await File.ReadAllLinesAsync(file);
|
||||
var moveLineNumber = json.Select((line, index) => new { line, index })
|
||||
.FirstOrDefault(x => x.line.Contains($"\"name\": \"{test.Ability.Effect}\""))?.index + 1;
|
||||
|
||||
@@ -72,7 +72,8 @@ public class MultiAttackTests
|
||||
user.Library.Returns(dynamicLibrary);
|
||||
dynamicLibrary.StaticLibrary.Returns(staticLibrary);
|
||||
staticLibrary.Types.Returns(typeLibrary);
|
||||
item.Name.Returns((StringKey)test.ItemName!);
|
||||
if (test.ItemName != null)
|
||||
item.Name.Returns(new StringKey(test.ItemName));
|
||||
move.User.Returns(user);
|
||||
|
||||
if (test.ItemName != null)
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// PreventCritical is a generic ability that prevents the user from being hit by critical hits.
|
||||
/// This ability completely blocks any incoming critical hits from opposing Pokémon.
|
||||
/// This ability is used by abilities like Battle Armor and Shell Armor.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Battle_Armor_(Ability)">Bulbapedia - Battle Armor</see>
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Shell_Armor_(Ability)">Bulbapedia - Shell Armor</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "prevent_critical")]
|
||||
public class PreventCritical : Script
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user