// Copyright HyperTwist, Inc. All Rights Reserved.

#include "Misc/AutomationTest.h"

#include "HyperTwistTraining/HyperTwistTrainingRuntimeLibrary.h"

#if WITH_AUTOMATION_TESTS

IMPLEMENT_SIMPLE_AUTOMATION_TEST(
	FHyperTwistValidationPhaseJBOMachicolationStatePacketContractTest,
	"HyperTwist.FirstParty.Validation.PhaseJBO.MachicolationStatePackets",
	EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter
)

bool FHyperTwistValidationPhaseJBOMachicolationStatePacketContractTest::RunTest(const FString& Parameters)
{
	FHyperTwistTrainingValidationMachicolationStatePacketContract Contract;
	TestTrue(
		TEXT("The validation machicolation-state packet contract must resolve from the runtime library."),
		UHyperTwistTrainingRuntimeLibrary::TryGetBundledValidationMachicolationStatePacketContract(
			TEXT("validation-machicolation-state-packet-contract"),
			Contract
		)
	);
	TestEqual(
		TEXT("The validation machicolation-state packet contract id must stay stable."),
		Contract.ContractId,
		TEXT("validation-machicolation-state-packet-contract")
	);
	TestTrue(
		TEXT("The validation machicolation-state packet contract must preserve benchmark-drift machicolation packets."),
		Contract.PacketIds.Contains(TEXT("machicolation-state-packet/benchmark-drift-machicolation"))
	);
	TestTrue(
		TEXT("The validation machicolation-state packet contract must preserve the bounded machicolation-state packet surface."),
		Contract.PacketSurfaceTags.Contains(TEXT("bounded machicolation-state packet"))
	);
	TestTrue(
		TEXT("The validation machicolation-state packet contract must preserve the no-generic-machicolation-state-platform guard."),
		Contract.MachicolationGuardTags.Contains(TEXT("no-generic-machicolation-state-platform guard"))
	);
	TestTrue(
		TEXT("The validation machicolation-state packet contract must keep generic machicolation-state platform ownership excluded."),
		Contract.ExplicitExclusions.Contains(TEXT("generic machicolation-state platform ownership"))
	);
	return true;
}

IMPLEMENT_SIMPLE_AUTOMATION_TEST(
	FHyperTwistValidationPhaseJBOOngoingStateFootnoteBoundaryTest,
	"HyperTwist.FirstParty.Validation.PhaseJBO.OngoingStateFootnotes",
	EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter
)

bool FHyperTwistValidationPhaseJBOOngoingStateFootnoteBoundaryTest::RunTest(const FString& Parameters)
{
	FHyperTwistTrainingValidationOngoingStateFootnoteBoundary Boundary;
	TestTrue(
		TEXT("The validation ongoing-state footnote boundary must resolve from the runtime library."),
		UHyperTwistTrainingRuntimeLibrary::TryGetBundledValidationOngoingStateFootnoteBoundary(
			TEXT("validation-ongoing-state-footnote-boundary"),
			Boundary
		)
	);
	TestEqual(
		TEXT("The validation ongoing-state footnote boundary id must stay stable."),
		Boundary.BoundaryId,
		TEXT("validation-ongoing-state-footnote-boundary")
	);
	TestTrue(
		TEXT("The validation ongoing-state footnote boundary must preserve manual-waiver footnotes."),
		Boundary.FootnoteIds.Contains(TEXT("ongoing-footnote/manual-waiver-footnote"))
	);
	TestTrue(
		TEXT("The validation ongoing-state footnote boundary must preserve the bounded ongoing-state footnote surface."),
		Boundary.FootnoteSurfaceTags.Contains(TEXT("bounded ongoing-state footnote"))
	);
	TestTrue(
		TEXT("The validation ongoing-state footnote boundary must preserve the no-generic-ongoing-footnote-platform guard."),
		Boundary.FootnoteGuardTags.Contains(TEXT("no-generic-ongoing-footnote-platform guard"))
	);
	TestTrue(
		TEXT("The validation ongoing-state footnote boundary must keep generic ongoing footnote platform ownership excluded."),
		Boundary.ExplicitExclusions.Contains(TEXT("generic ongoing footnote platform ownership"))
	);
	return true;
}

#endif
