// Copyright HyperTwist, Inc. All Rights Reserved.

#include "Misc/AutomationTest.h"

#include "HyperTwistTraining/HyperTwistTrainingRuntimeLibrary.h"

#if WITH_AUTOMATION_TESTS

IMPLEMENT_SIMPLE_AUTOMATION_TEST(
	FHyperTwistValidationPhaseJBJBattlementStateLedgerContractTest,
	"HyperTwist.FirstParty.Validation.PhaseJBJ.BattlementStateLedgers",
	EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter
)

bool FHyperTwistValidationPhaseJBJBattlementStateLedgerContractTest::RunTest(const FString& Parameters)
{
	FHyperTwistTrainingValidationBattlementStateLedgerContract Contract;
	TestTrue(
		TEXT("The validation battlement-state ledger contract must resolve from the runtime library."),
		UHyperTwistTrainingRuntimeLibrary::TryGetBundledValidationBattlementStateLedgerContract(
			TEXT("validation-battlement-state-ledger-contract"),
			Contract
		)
	);
	TestEqual(
		TEXT("The validation battlement-state ledger contract id must stay stable."),
		Contract.ContractId,
		TEXT("validation-battlement-state-ledger-contract")
	);
	TestTrue(
		TEXT("The validation battlement-state ledger contract must preserve benchmark-drift battlement ledgers."),
		Contract.LedgerIds.Contains(TEXT("battlement-state-ledger/benchmark-drift-battlement"))
	);
	TestTrue(
		TEXT("The validation battlement-state ledger contract must preserve the bounded battlement-state ledger surface."),
		Contract.LedgerSurfaceTags.Contains(TEXT("bounded battlement-state ledger"))
	);
	TestTrue(
		TEXT("The validation battlement-state ledger contract must preserve the no-generic-battlement-state-platform guard."),
		Contract.BattlementGuardTags.Contains(TEXT("no-generic-battlement-state-platform guard"))
	);
	TestTrue(
		TEXT("The validation battlement-state ledger contract must keep generic battlement-state platform ownership excluded."),
		Contract.ExplicitExclusions.Contains(TEXT("generic battlement-state platform ownership"))
	);
	return true;
}

IMPLEMENT_SIMPLE_AUTOMATION_TEST(
	FHyperTwistValidationPhaseJBJOngoingStateCaptionBoundaryTest,
	"HyperTwist.FirstParty.Validation.PhaseJBJ.OngoingStateCaptions",
	EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter
)

bool FHyperTwistValidationPhaseJBJOngoingStateCaptionBoundaryTest::RunTest(const FString& Parameters)
{
	FHyperTwistTrainingValidationOngoingStateCaptionBoundary Boundary;
	TestTrue(
		TEXT("The validation ongoing-state caption boundary must resolve from the runtime library."),
		UHyperTwistTrainingRuntimeLibrary::TryGetBundledValidationOngoingStateCaptionBoundary(
			TEXT("validation-ongoing-state-caption-boundary"),
			Boundary
		)
	);
	TestEqual(
		TEXT("The validation ongoing-state caption boundary id must stay stable."),
		Boundary.BoundaryId,
		TEXT("validation-ongoing-state-caption-boundary")
	);
	TestTrue(
		TEXT("The validation ongoing-state caption boundary must preserve manual-waiver captions."),
		Boundary.CaptionIds.Contains(TEXT("ongoing-caption/manual-waiver-caption"))
	);
	TestTrue(
		TEXT("The validation ongoing-state caption boundary must preserve the bounded ongoing-state caption surface."),
		Boundary.CaptionSurfaceTags.Contains(TEXT("bounded ongoing-state caption"))
	);
	TestTrue(
		TEXT("The validation ongoing-state caption boundary must preserve the no-generic-ongoing-caption-platform guard."),
		Boundary.CaptionGuardTags.Contains(TEXT("no-generic-ongoing-caption-platform guard"))
	);
	TestTrue(
		TEXT("The validation ongoing-state caption boundary must keep generic ongoing caption platform ownership excluded."),
		Boundary.ExplicitExclusions.Contains(TEXT("generic ongoing caption platform ownership"))
	);
	return true;
}

#endif
