Unit test: custom UGameInstance


I have my own implementation of UGameInstance derived class. I’d like to test some of its methods in unit tests, that is using the IMPLEMENT_SIMPLE_AUTOMATION_TEST() macro. My problem is that GEngine->GetWorld() is always nullptr during the test execution, therefore I’m not able to get the instance of my class with UWorld::GetGameInstance() method.

How do I get any world in unit test?
How do I get Game Instance object in unit test?

I think this one is related, but no good answer: Unit testing methods in custom gamestate class - C++ - Unreal Engine Forums