Widget Studio
WSEditorTestClass.h
1/*
2* Copyright (c) 2021 THEIA INTERACTIVE. All rights reserved.
3*
4* Website: https://widgetstudio.design
5* Documentation: https://docs.widgetstudio.design
6* Support: marketplace@theia.io
7* Marketplace FAQ: https://marketplacehelp.epicgames.com
8*/
9
10#pragma once
11
12#include "CoreMinimal.h"
13#include "WSSettings.h"
14#include "WSEditorTestClass.generated.h"
15
16DECLARE_LOG_CATEGORY_EXTERN(LogWS_Editor_TESTS, All, All);
17
21UCLASS(Blueprintable, BlueprintType)
22class WIDGETSTUDIOEDITOR_API UWidgetStudioEditorTestClass : public UObject
23{
24 GENERATED_BODY()
25
26public:
31
33
40 UFUNCTION(BlueprintCallable, Category = "Test Editor")
41 void PerformAllTests();
42
46 void LogTestResult(FString TestName, bool bDidTestPass, bool bPlaceNewlineAfter);
47
53 bool TestVerifyWidgetStudioInCookDirs();
54
59 bool TestRemoveWidgetStudioFromCookDirs();
60
66 bool TestUpdateTheme();
67
73 bool TestUpdateIconSet();
74
80 bool TestUpdateTypography();
81
87 bool TestUpdateBorderRadius();
88
94 bool TestUpdateControlDimensions();
95
101 bool TestThemePreservedWhenNewCreated();
102
103private:
104
113 bool SaveAsset(UPackage* AssetPackage, UObject* CreatedAsset, FString AssetName, UClass* Class);
114
115 UPROPERTY()
116 UWidgetStudioSettings* Settings;
117
118 TSoftObjectPtr<UWidgetStudioTheme> NordDarkTheme;
119 TSoftObjectPtr<UWidgetStudioTheme> NordLightTheme;
120 TSoftObjectPtr<UWidgetStudioIconSet> DefaultIconSet;
121 TSoftObjectPtr<UWidgetStudioIconSet> TestIconSet;
122 TSoftObjectPtr<UWidgetStudioTypography> OpenSansTypography;
123 TSoftObjectPtr<UWidgetStudioTypography> TestTypography;
124};
Test class to perform unit tests.
Definition: WSEditorTestClass.h:23
The Widget Studio editor settings.
Definition: WSSettings.h:28