Navigation
API > API/Developer > API/Developer/CQTest
Description
/Example boiler plate
if WITH_AUTOMATION_TESTS
include "CQTest.h" #include "Components/CQTestBlueprintHelper.h"
TEST_CLASS_WITH_FLAGS(MyFixtureName, "BlueprintHelper.Example", EAutomationTestFlags::EditorContext | EAutomationTestFlags::ProductFilter) { FCQTestBlueprintHelper BlueprintHelper;
TEST_METHOD(Object_FromBlueprint_IsLoaded) { UClass* Class = BlueprintHelper.GetBlueprintClass(TEXT("/Package/Path/To/Asset"), TEXT("B_Asset")); ASSERT_THAT(IsNotNull(Class));
UObject* Object = BlueprintHelper.FindDataBlueprint(TEXT("/Package/Path/To/Asset"), TEXT("B_Asset")); ASSERT_THAT(IsNotNull(Object)); } };
endif // WITH_AUTOMATION_TESTS Utilities for working with Blueprint in C++ Tests Gets the UClass of a UObject loaded from a given directory and asset name.
Method guarantees that the UClass returned is valid, will assert otherwise.
| Name | GetBlueprintClass |
| Type | function |
| Header File | /Engine/Source/Developer/CQTest/Public/Components/CQTestBlueprintHelper.h |
| Include Path | #include "Components/CQTestBlueprintHelper.h" |
| Source | /Engine/Source/Developer/CQTest/Private/Components/CQTestBlueprintHelper.cpp |
UClass * GetBlueprintClass
(
const FString & Directory,
const FString & Name
)
pointer of the blueprint's generated class
Parameters
| Name | Remarks |
|---|---|
| Directory | Directory path where the asset resides. |
| Name | Name of the asset. |