2019-09-27 20:22:54 -07:00
using FluentAssertions ;
using Xunit ;
2023-01-21 20:02:33 -08:00
namespace PKHeX.Core.Tests.Legality ;
2022-06-18 11:04:24 -07:00
public class LegalityData
2019-09-27 20:22:54 -07:00
{
2023-07-06 19:41:27 -07:00
[Theory]
[InlineData(Species.Feebas, 0)] // feebas, see issue #2394
[InlineData(Species.Crabrawler, 0)] // SV Crabrawler added a second, UseItem evolution method. Need to be sure it's before the more restrictive level-up method.
public void EvolutionsOrdered ( Species species , byte form )
2019-09-27 20:22:54 -07:00
{
2023-07-05 21:14:09 -07:00
int count = 0 ;
2023-07-06 19:41:27 -07:00
for ( var context = EntityContext . None + 1 ; context < EntityContext . MaxInvalid ; context + + )
2023-07-05 21:14:09 -07:00
{
2023-07-06 19:41:27 -07:00
if ( ! context . IsValid ( ) )
continue ;
var tree = EvolutionTree . GetEvolutionTree ( context ) ;
var possible = tree . Forward . GetForward ( ( ushort ) species , form ) . Span ;
if ( possible . Length < = 1 )
2022-06-18 11:04:24 -07:00
continue ;
2019-09-27 20:22:54 -07:00
2023-07-06 19:41:27 -07:00
var t1 = possible [ 0 ] . Method ;
var t2 = possible [ 1 ] . Method ;
2019-09-27 20:22:54 -07:00
2022-06-18 11:04:24 -07:00
t1 . IsLevelUpRequired ( ) . Should ( ) . BeFalse ( ) ;
t2 . IsLevelUpRequired ( ) . Should ( ) . BeTrue ( ) ;
2023-07-05 21:14:09 -07:00
count + + ;
2019-09-27 20:22:54 -07:00
}
2023-07-05 21:14:09 -07:00
2023-07-06 19:41:27 -07:00
count . Should ( ) . BeGreaterThan ( 0 ) ;
2022-12-10 19:53:59 -08:00
}
2022-06-18 11:04:24 -07:00
}