PKHeX/Tests/PKHeX.Core.Tests/General/MarshalTests.cs
Kurt dcc0e79435
Evotree: Evolution Traversal Enhancements (#3936)
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.
2023-07-05 21:14:09 -07:00

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);
}