#include "HyperTwistTraining/HyperTwistTrainingRuntimeLibrary.h"

#include "Misc/AutomationTest.h"

IMPLEMENT_SIMPLE_AUTOMATION_TEST(
	FHyperTwistValidationPhaseJFIAspergillumStatePacketContractTest,
	"HyperTwist.Validation.PhaseJFI.AspergillumStatePacketContract",
	EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter
)

bool FHyperTwistValidationPhaseJFIAspergillumStatePacketContractTest::RunTest(const FString& Parameters)
{
	FHyperTwistTrainingValidationAspergillumStatePacketContract Contract;
	const bool bResolved = UHyperTwistTrainingRuntimeLibrary::TryGetBundledValidationAspergillumStatePacketContract(
		TEXT("validation-aspergillum-state-packet-contract"),
		Contract);

	TestTrue(
		TEXT("The validation aspergillum-state packet contract must resolve from the runtime library."),
		bResolved);
	if (!bResolved)
	{
		return false;
	}

	TestEqual(
		TEXT("The validation aspergillum-state packet contract id must stay stable."),
		Contract.ContractId,
		FString(TEXT("validation-aspergillum-state-packet-contract")));
	TestTrue(
		TEXT("The validation aspergillum-state packet contract must preserve benchmark-drift aspergillum packets."),
		Contract.PacketIds.Contains(TEXT("aspergillum-state-packet/benchmark-drift-aspergillum")));
	TestTrue(
		TEXT("The validation aspergillum-state packet contract must preserve the bounded aspergillum-state packet surface."),
		Contract.PacketSurfaceTags.Contains(TEXT("bounded aspergillum-state packet")));
	TestTrue(
		TEXT("The validation aspergillum-state packet contract must preserve the no-generic-aspergillum-state-platform guard."),
		Contract.AspergillumGuardTags.Contains(TEXT("no-generic-aspergillum-state-platform guard")));
	TestTrue(
		TEXT("The validation aspergillum-state packet contract must keep generic aspergillum-state platform ownership excluded."),
		Contract.ExplicitExclusions.Contains(TEXT("generic aspergillum-state platform ownership")));

	return true;
}

IMPLEMENT_SIMPLE_AUTOMATION_TEST(
	FHyperTwistValidationPhaseJFIOngoingStateAspersoriumBoundaryTest,
	"HyperTwist.Validation.PhaseJFI.OngoingStateAspersoriumBoundary",
	EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter
)

bool FHyperTwistValidationPhaseJFIOngoingStateAspersoriumBoundaryTest::RunTest(const FString& Parameters)
{
	FHyperTwistTrainingValidationOngoingStateAspersoriumBoundary Boundary;
	const bool bResolved = UHyperTwistTrainingRuntimeLibrary::TryGetBundledValidationOngoingStateAspersoriumBoundary(
		TEXT("validation-ongoing-state-aspersorium-boundary"),
		Boundary);

	TestTrue(
		TEXT("The validation ongoing-state aspersorium boundary must resolve from the runtime library."),
		bResolved);
	if (!bResolved)
	{
		return false;
	}

	TestEqual(
		TEXT("The validation ongoing-state aspersorium boundary id must stay stable."),
		Boundary.BoundaryId,
		FString(TEXT("validation-ongoing-state-aspersorium-boundary")));
	TestTrue(
		TEXT("The validation ongoing-state aspersorium boundary must preserve manual-waiver aspersorium anchors."),
		Boundary.AspersoriumIds.Contains(TEXT("ongoing-aspersorium/manual-waiver-aspersorium")));
	TestTrue(
		TEXT("The validation ongoing-state aspersorium boundary must preserve the bounded ongoing-state aspersorium surface."),
		Boundary.AspersoriumSurfaceTags.Contains(TEXT("bounded ongoing-state aspersorium")));
	TestTrue(
		TEXT("The validation ongoing-state aspersorium boundary must preserve the no-generic-ongoing-aspersorium-platform guard."),
		Boundary.AspersoriumGuardTags.Contains(TEXT("no-generic-ongoing-aspersorium-platform guard")));
	TestTrue(
		TEXT("The validation ongoing-state aspersorium boundary must keep generic ongoing aspersorium platform ownership excluded."),
		Boundary.ExplicitExclusions.Contains(TEXT("generic ongoing aspersorium platform ownership")));

	return true;
}
