See also: Automation Specs
#include "DateTimeFunctionLibrary.h"
#include "Misc/AutomationTest.h"
IMPLEMENT_SIMPLE_AUTOMATION_TEST(KotDateFunctionsTest, "KingOfTapes.KotDateFunctionsTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter)
bool KotDateFunctionsTest::RunTest(const FString& Parameters)
{
TestTrue(TEXT("1.1.1980 is older by 10 years to 1.1.1990"), UDateTimeFunctionLibrary::IsOlderThanYears(FDateTime(1990, 1, 1), FDateTime(1980, 1, 1), 10));
TestFalse(TEXT("2.1.1980 is not older by 10 years to 1.1.1990"), UDateTimeFunctionLibrary::IsOlderThanYears(FDateTime(1990, 1, 1), FDateTime(1980, 1, 2), 10));
// Make the test pass by returning true, or fail by returning false.
return true;
}