mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-04-28 11:37:26 -05:00
Check all languages for correct lengths
pesky eol
This commit is contained in:
parent
e63d514367
commit
2560b7c677
|
|
@ -8,17 +8,15 @@ indent_size = 4
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
# Solution Files
|
[*.txt]
|
||||||
[*.sln]
|
insert_final_newline = false
|
||||||
indent_style = space
|
|
||||||
indent_size = 4
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
# XML Project Files
|
# Solution Files, XML Project Files
|
||||||
[*.csproj]
|
[*.{sln,csproj}]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
# Code Files
|
# Code Files
|
||||||
[*.cs]
|
[*.cs]
|
||||||
|
|
|
||||||
|
|
@ -918,4 +918,4 @@ Plancha Voltaica
|
||||||
Psicorruido
|
Psicorruido
|
||||||
Palma Rauda
|
Palma Rauda
|
||||||
Cadena Virulenta
|
Cadena Virulenta
|
||||||
Luz Devastadora
|
Luz Devastadora
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
|
|
@ -5,24 +7,36 @@ namespace PKHeX.Core.Tests.Util;
|
||||||
|
|
||||||
public class DataUtilTests
|
public class DataUtilTests
|
||||||
{
|
{
|
||||||
[Fact]
|
public static TheoryData<string> AllLanguages
|
||||||
public void GetsCorrectNumberOfSpeciesNames()
|
|
||||||
{
|
{
|
||||||
var names = Core.Util.GetSpeciesList(GameLanguage.DefaultLanguage);
|
get
|
||||||
names.Length.Should().Be((int)Species.MAX_COUNT);
|
{
|
||||||
|
var data = new TheoryData<string>();
|
||||||
|
foreach (var lang in GameLanguage.AllSupportedLanguages)
|
||||||
|
data.Add(lang);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Theory]
|
||||||
public void GetsCorrectNumberOfAbilityNames()
|
[MemberData(nameof(AllLanguages))]
|
||||||
{
|
public void GetsCorrectNumberOfSpeciesNames(string language)
|
||||||
var names = Core.Util.GetAbilitiesList(GameLanguage.DefaultLanguage);
|
=> VerifyArrayLength(language, static s => s.specieslist, (int)Species.MAX_COUNT);
|
||||||
names.Length.Should().Be((int)Ability.MAX_COUNT);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
[Theory]
|
||||||
public void GetsCorrectNumberOfMoveNames()
|
[MemberData(nameof(AllLanguages))]
|
||||||
|
public void GetsCorrectNumberOfAbilityNames(string language)
|
||||||
|
=> VerifyArrayLength(language, static s => s.abilitylist, (int)Ability.MAX_COUNT);
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[MemberData(nameof(AllLanguages))]
|
||||||
|
public void GetsCorrectNumberOfMoveNames(string language)
|
||||||
|
=> VerifyArrayLength(language, static s => s.movelist, (int)Move.MAX_COUNT);
|
||||||
|
|
||||||
|
private static void VerifyArrayLength(string language, Func<GameStrings, string[]> accessor, [ConstantExpected] int expected)
|
||||||
{
|
{
|
||||||
var names = Core.Util.GetMovesList(GameLanguage.DefaultLanguage);
|
var strings = GameInfo.GetStrings(language);
|
||||||
names.Length.Should().Be((int)Move.MAX_COUNT);
|
var names = accessor(strings);
|
||||||
|
names.Length.Should().Be(expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user