mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 14:30:56 +00:00
dcc0e79435
Like move validation, evolutions are the earliest thing we wish to traverse when determining what encounters may have originated the current Pokémon. To determine the permitted species-form-levels a Pokémon could originate with, we must devolve a Pokémon by traveling down-generation to origin. Once we have an encounter, we can then evolve it to the current species, traversing upwards from origin to the current format.
25 lines
816 B
C#
25 lines
816 B
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using FluentAssertions;
|
|
using Xunit;
|
|
|
|
namespace PKHeX.Core.Tests.General;
|
|
|
|
public class MarshalTests
|
|
{
|
|
[Theory]
|
|
[InlineData(8, typeof(PIDIV))]
|
|
[InlineData(8, typeof(MoveResult))]
|
|
[InlineData(8, typeof(EvolutionMethod))]
|
|
[InlineData(8, typeof(Moveset))]
|
|
public void MarshalSizeExact(int expect, Type t) => Marshal.SizeOf(t).Should().Be(expect);
|
|
|
|
[Theory]
|
|
[InlineData( 8, typeof(NPCLock))]
|
|
[InlineData( 8, typeof(IndividualValueSet))]
|
|
[InlineData(16, typeof(DreamWorldEntry))]
|
|
[InlineData(16, typeof(CheckResult))]
|
|
[InlineData(16, typeof(EvolutionLink))]
|
|
[InlineData(24, typeof(GenerateParam9))]
|
|
public void MarshalSizeLessThanEqual(int expect, Type t) => Marshal.SizeOf(t).Should().BeLessOrEqualTo(expect);
|
|
}
|