FSetResTest example in technical guide doesn't compile

I am looking at test automation within Unreal and looked at the technical reference guide.

I have created a file called FSetRestTest.cpp and added the example code to it and included the headers. But it didn’t compile. FEngineAutomationTestUtilities doesn’t exist, GSystemSettings doesn’t exist…

#include "AutomationCommon.h"
#include "AutomationTest.h"

IMPLEMENT_SIMPLE_AUTOMATION_TEST( FSetResTest, "Windows.SetResolution", ATF_Game )
bool FSetResTest::RunTest(const FString& Parameters)
{
    FString MapName = TEXT("AutomationTest");
    FEngineAutomationTestUtilities::LoadMap(MapName);

    int32 ResX = GSystemSettings.ResX;
    int32 ResY = GSystemSettings.ResY;
    FString RestoreResolutionString = FString::Printf(TEXT("setres %dx%d"), ResX, ResY);

    ADD_LATENT_AUTOMATION_COMMAND(FEngineWaitLatentCommand(2.0f));
    ADD_LATENT_AUTOMATION_COMMAND(FExecStringLatentCommand(TEXT("setres 640x480")));
    ADD_LATENT_AUTOMATION_COMMAND(FEngineWaitLatentCommand(2.0f));
    ADD_LATENT_AUTOMATION_COMMAND(FExecStringLatentCommand(RestoreResolutionString));

    return true;
}

I tried to alter the code so that it is at least nog giving me compilation errors, but I still get linker errors.

LNK2001 unresolved external symbol “public: virtual bool __cdecl FLoadGameMapCommand::Update(void)” (?Update@FLoadGameMapCommand@@UEAA_NXZ)

#include "AutomationCommon.h"
#include "AutomationTest.h"
#include "Engine/Engine.h"
#include "Engine/GameViewportClient.h"

IMPLEMENT_SIMPLE_AUTOMATION_TEST(FSetRestTest, "Windows.SetResolution", EAutomationTestFlags::EngineFilter | EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext)
bool FSetRestTest::RunTest(const FString& Parameters)
{
    FString MapName = TEXT("AutomationTest");
    ADD_LATENT_AUTOMATION_COMMAND(FLoadGameMapCommand(MapName));
    const FVector2D ViewportSize = FVector2D(GEngine->GameViewport->Viewport->GetSizeXY());
    FString RestoreResolutionString = FString::Printf(TEXT("setres %dx%d"), ViewportSize.X, ViewportSize.Y);
    
    ADD_LATENT_AUTOMATION_COMMAND(FEngineWaitLatentCommand(2.0f));
    ADD_LATENT_AUTOMATION_COMMAND(FExecStringLatentCommand(TEXT("setres 640x480")));
    ADD_LATENT_AUTOMATION_COMMAND(FEngineWaitLatentCommand(2.0f));
    ADD_LATENT_AUTOMATION_COMMAND(FExecStringLatentCommand(RestoreResolutionString));
    
    return true;
}

Also, when I change the configuration to Development it compiles, but when I set it to Development Editor it doesn’t.

How can I fix the linker errors for ADD_LATENT_AUTOMATION_COMMAND?

I’m also having this issue.