mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-03-21 17:48:28 -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
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# Solution Files
|
||||
[*.sln]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
[*.txt]
|
||||
insert_final_newline = false
|
||||
|
||||
# XML Project Files
|
||||
[*.csproj]
|
||||
# Solution Files, XML Project Files
|
||||
[*.{sln,csproj}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# Code Files
|
||||
[*.cs]
|
||||
|
|
|
|||
|
|
@ -918,4 +918,4 @@ Plancha Voltaica
|
|||
Psicorruido
|
||||
Palma Rauda
|
||||
Cadena Virulenta
|
||||
Luz Devastadora
|
||||
Luz Devastadora
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
|
||||
|
|
@ -5,24 +7,36 @@ namespace PKHeX.Core.Tests.Util;
|
|||
|
||||
public class DataUtilTests
|
||||
{
|
||||
[Fact]
|
||||
public void GetsCorrectNumberOfSpeciesNames()
|
||||
public static TheoryData<string> AllLanguages
|
||||
{
|
||||
var names = Core.Util.GetSpeciesList(GameLanguage.DefaultLanguage);
|
||||
names.Length.Should().Be((int)Species.MAX_COUNT);
|
||||
get
|
||||
{
|
||||
var data = new TheoryData<string>();
|
||||
foreach (var lang in GameLanguage.AllSupportedLanguages)
|
||||
data.Add(lang);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetsCorrectNumberOfAbilityNames()
|
||||
{
|
||||
var names = Core.Util.GetAbilitiesList(GameLanguage.DefaultLanguage);
|
||||
names.Length.Should().Be((int)Ability.MAX_COUNT);
|
||||
}
|
||||
[Theory]
|
||||
[MemberData(nameof(AllLanguages))]
|
||||
public void GetsCorrectNumberOfSpeciesNames(string language)
|
||||
=> VerifyArrayLength(language, static s => s.specieslist, (int)Species.MAX_COUNT);
|
||||
|
||||
[Fact]
|
||||
public void GetsCorrectNumberOfMoveNames()
|
||||
[Theory]
|
||||
[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);
|
||||
names.Length.Should().Be((int)Move.MAX_COUNT);
|
||||
var strings = GameInfo.GetStrings(language);
|
||||
var names = accessor(strings);
|
||||
names.Length.Should().Be(expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user