Test class to perform unit tests. More...
#include <WSTestClass.h>
Public Member Functions | |
UWidgetStudioTestClass () | |
Constructor - Load data assets. | |
void | PerformAllTests () |
Performs all cpp tests for the Runtime module. More... | |
void | ResetTheme () |
Helper function – Reset all values in the given .ini file to original defaults. | |
bool | FuncLibTestGetControlDimensions () |
Test getting current control dimensions by setting values and getting them through func lib function. More... | |
bool | FuncLibTestGetBorderRadius () |
Test getting current border radius by setting values and getting them through func lib function. More... | |
bool | FuncLibTestGetCurrentTheme () |
Test getting current theme by setting values and getting them through func lib function. More... | |
bool | FuncLibTestGetCurrentTypography () |
Test getting current typography by setting values and getting them through func lib function. More... | |
bool | FuncLibTestGetCurrentIconSet () |
Test getting current icon set by setting values and getting them through func lib function. More... | |
bool | FuncLibTestSetTheme () |
Test setting theme using func lib function, then retrieving it to make sure it was set properly. More... | |
bool | FuncLibTestSetIconSet () |
Test setting icon set using func lib function, then retrieving it to make sure it was set properly. More... | |
bool | FuncLibTestSetTypography () |
Test setting typography using func lib function, then retrieving it to make sure it was set properly. More... | |
bool | FuncLibTestInterpWidgetColor () const |
Test InterpWidgetColor by calling function on one widget and doing interp manually on another, then comparing the results. More... | |
bool | FuncLibTestInterpImageColor () const |
Test InterpImageColor by calling function on one widget and doing interp manually on another, then comparing the results. More... | |
bool | FuncLibTestInterpTextColor () const |
Test InterpTextColor by calling function on one widget and doing interp manually on another, then comparing the results. More... | |
bool | FuncLibTestInterpEditableTextBoxColor () const |
Test InterpEditableTextBoxColor by calling function on one widget and doing interp manually on another, then comparing the results. More... | |
bool | FuncLibTestInterpSizeBoxOverrides () const |
Test InterpSizeBoxOverrides by calling function on one widget and doing interp manually on another, then comparing the results. More... | |
bool | FuncLibTestInterpSizeBoxMinOverrides () const |
Test InterpSizeBoxMinOverrides by calling function on one widget and doing interp manually on another, then comparing the results. More... | |
bool | FuncLibTestInterpWidgetTranslation () const |
Test InterpWidgetTranslation by calling function on one widget and doing interp manually on another, then comparing the results. More... | |
bool | FuncLibTestInterpWidgetScale () const |
Test InterpWidgetScale by calling function on one widget and doing interp manually on another, then comparing the results. More... | |
bool | FuncLibTestInterpWidgetRotation () const |
Test InterpWidgetRotation by calling function on one widget and doing interp manually on another, then comparing the results. More... | |
bool | FuncLibTestInterpWidgetOpacity () const |
Test InterpWidgetOpacity by calling function on one widget and doing interp manually on another, then comparing the results. More... | |
bool | TestGetTheme () |
WSSubsystem Tests. More... | |
bool | TestGetIconSet () |
Test getting current icon set by setting values and getting them through WS Subsystem function. More... | |
bool | TestGetTypography () |
Test getting current typography by setting values and getting them through WS Subsystem function. More... | |
bool | TestGetBorderRadius () |
Test getting current border radius by setting values and getting them through WS Subsystem function. More... | |
bool | TestGetControlDimensions () |
Test getting current control dimensions by setting values and getting them through WS Subsystem function. More... | |
bool | TestSetTheme () |
Test setting theme using WS Subsystem function, then retrieving it to make sure it was set properly. More... | |
bool | TestSetIconSet () |
Test setting icon set using WS Subsystem function, then retrieving it to make sure it was set properly. More... | |
bool | TestSetTypography () |
Test setting typography using WS Subsystem function, then retrieving it to make sure it was set properly. More... | |
bool | TestSetBorderRadius () |
Test setting border radius using WS Subsystem function, then retrieving it to make sure it was set properly. More... | |
bool | TestSetControlDimensions () |
Test setting control dimensions using WS Subsystem function, then retrieving it to make sure it was set properly. More... | |
bool | TestResetTheme () |
Test ResetTheme() by passing in non-default values, then calling function, then testing to make sure new values match plugin defaults. More... | |
Static Public Member Functions | |
static void | LogTestResult (FString TestName, bool bDidTestPass, bool bPlaceNewlineAfter) |
Logs pass/fail result of each test. | |
static bool | FuncLibTestGetColorFromPalette () |
WSFunctionLibrary Tests. More... | |
static bool | FuncLibTestGetColorBasedValue () |
Test getting color-based value from each part of the value range. More... | |
static bool | FuncLibTestGetPaletteBasedValue () |
Test getting palette-based value from each part of the value range. More... | |
static bool | FuncLibTestGetTextureFromIconLibrary () |
Test getting texture from icon library using current EIconItem:Bookmark. More... | |
static bool | FuncLibTestGetSizeByModifier () |
Test GetSizeByModifier() by comparing hard-coded value to result of calling function. More... | |
static bool | FuncLibTestGetRoundedBackgroundMaterial () |
Test InterpBrushImageSize by calling function on one widget and doing interp manually on another, then comparing the results. More... | |
static bool | FuncLibTestGetRoundedOutlineMaterial () |
Test getting rounded outline material by setting it, then retrieving it. More... | |
static bool | FuncLibTestGetRoundedShadowMaterial () |
Test getting rounded shadow material by setting it, then retrieving it. More... | |
static bool | FuncLibTestGetTypefaceFromTypography () |
Test getting typeface from typography by getting the value manually, then calling the function, then comparing results. More... | |
static bool | FuncLibTestContainsNumbers () |
Test ContainsNumbers() by running func on two strings; one with number, one without number. More... | |
static bool | FuncLibTestFilterByCharacterLimit () |
Test FilterByCharacterLimit() by comparing manually truncated string to result of function. More... | |
static bool | FuncLibTestConstructFontInfoFromTypography () |
Test ConstructFontInfoFromTypography() by comparing hard-coded font to font retrieved from function. More... | |
static bool | FuncLibTestConstructFontInfoFromStyle () |
Test ConstructFontInfoFromStyle() by comparing hard-coded font to font retrieved from function. More... | |
static bool | FuncLibTestGetTypeScaleFromTypography () |
Test GetTypeScaleFromTypography() by comparing hard-coded font to font retrieved from function. More... | |
static bool | FuncLibTestGetFontWeightName () |
Test GetFontWeightName() by comparing hard-coded font to font retrieved from function. More... | |
static bool | TestGetAdjustedPercent () |
Utility Function Tests. | |
Public Attributes | |
UWidgetStudioSubsystem * | WSSubsystem = nullptr |
TSoftObjectPtr< UWidgetStudioTheme > | NordDarkTheme |
TSoftObjectPtr< UWidgetStudioTheme > | NordLightTheme |
TSoftObjectPtr< UWidgetStudioIconSet > | DefaultIconSet |
TSoftObjectPtr< UWidgetStudioIconSet > | TestIconSet |
TSoftObjectPtr< UWidgetStudioTypography > | OpenSansTypography |
TSoftObjectPtr< UWidgetStudioTypography > | TestTypography |
Test class to perform unit tests.
|
static |
Test ConstructFontInfoFromStyle() by comparing hard-coded font to font retrieved from function.
|
static |
Test ConstructFontInfoFromTypography() by comparing hard-coded font to font retrieved from function.
|
static |
Test ContainsNumbers() by running func on two strings; one with number, one without number.
|
static |
Test FilterByCharacterLimit() by comparing manually truncated string to result of function.
bool UWidgetStudioTestClass::FuncLibTestGetBorderRadius | ( | ) |
Test getting current border radius by setting values and getting them through func lib function.
|
static |
Test getting color-based value from each part of the value range.
|
static |
WSFunctionLibrary Tests.
Test getting color from palette with variable, constant, and invalid cases
bool UWidgetStudioTestClass::FuncLibTestGetControlDimensions | ( | ) |
Test getting current control dimensions by setting values and getting them through func lib function.
bool UWidgetStudioTestClass::FuncLibTestGetCurrentIconSet | ( | ) |
Test getting current icon set by setting values and getting them through func lib function.
bool UWidgetStudioTestClass::FuncLibTestGetCurrentTheme | ( | ) |
Test getting current theme by setting values and getting them through func lib function.
bool UWidgetStudioTestClass::FuncLibTestGetCurrentTypography | ( | ) |
Test getting current typography by setting values and getting them through func lib function.
|
static |
Test GetFontWeightName() by comparing hard-coded font to font retrieved from function.
|
static |
Test getting palette-based value from each part of the value range.
|
static |
Test InterpBrushImageSize by calling function on one widget and doing interp manually on another, then comparing the results.
|
static |
Test getting rounded outline material by setting it, then retrieving it.
|
static |
Test getting rounded shadow material by setting it, then retrieving it.
|
static |
Test GetSizeByModifier() by comparing hard-coded value to result of calling function.
|
static |
Test getting texture from icon library using current EIconItem:Bookmark.
|
static |
Test getting typeface from typography by getting the value manually, then calling the function, then comparing results.
|
static |
Test GetTypeScaleFromTypography() by comparing hard-coded font to font retrieved from function.
bool UWidgetStudioTestClass::FuncLibTestInterpEditableTextBoxColor | ( | ) | const |
Test InterpEditableTextBoxColor by calling function on one widget and doing interp manually on another, then comparing the results.
bool UWidgetStudioTestClass::FuncLibTestInterpImageColor | ( | ) | const |
Test InterpImageColor by calling function on one widget and doing interp manually on another, then comparing the results.
bool UWidgetStudioTestClass::FuncLibTestInterpSizeBoxMinOverrides | ( | ) | const |
Test InterpSizeBoxMinOverrides by calling function on one widget and doing interp manually on another, then comparing the results.
bool UWidgetStudioTestClass::FuncLibTestInterpSizeBoxOverrides | ( | ) | const |
Test InterpSizeBoxOverrides by calling function on one widget and doing interp manually on another, then comparing the results.
bool UWidgetStudioTestClass::FuncLibTestInterpTextColor | ( | ) | const |
Test InterpTextColor by calling function on one widget and doing interp manually on another, then comparing the results.
bool UWidgetStudioTestClass::FuncLibTestInterpWidgetColor | ( | ) | const |
Test InterpWidgetColor by calling function on one widget and doing interp manually on another, then comparing the results.
bool UWidgetStudioTestClass::FuncLibTestInterpWidgetOpacity | ( | ) | const |
Test InterpWidgetOpacity by calling function on one widget and doing interp manually on another, then comparing the results.
bool UWidgetStudioTestClass::FuncLibTestInterpWidgetRotation | ( | ) | const |
Test InterpWidgetRotation by calling function on one widget and doing interp manually on another, then comparing the results.
bool UWidgetStudioTestClass::FuncLibTestInterpWidgetScale | ( | ) | const |
Test InterpWidgetScale by calling function on one widget and doing interp manually on another, then comparing the results.
bool UWidgetStudioTestClass::FuncLibTestInterpWidgetTranslation | ( | ) | const |
Test InterpWidgetTranslation by calling function on one widget and doing interp manually on another, then comparing the results.
bool UWidgetStudioTestClass::FuncLibTestSetIconSet | ( | ) |
Test setting icon set using func lib function, then retrieving it to make sure it was set properly.
Run with two different icon sets in case first test set is the same as initial
bool UWidgetStudioTestClass::FuncLibTestSetTheme | ( | ) |
Test setting theme using func lib function, then retrieving it to make sure it was set properly.
Run with two different themes in case first test theme is the same as initial
bool UWidgetStudioTestClass::FuncLibTestSetTypography | ( | ) |
Test setting typography using func lib function, then retrieving it to make sure it was set properly.
Run with two different typography sets in case first typography is the same as initial
void UWidgetStudioTestClass::PerformAllTests | ( | ) |
Performs all cpp tests for the Runtime module.
Can be run from Editor python cmd with: import unreal RuntimeTestClass = unreal.WidgetStudioTestClass() result = RuntimeTestClass.perform_all_tests()
WSFunctionLibrary Tests
WSSubsystem Tests
Utility Function Tests
bool UWidgetStudioTestClass::TestGetBorderRadius | ( | ) |
Test getting current border radius by setting values and getting them through WS Subsystem function.
bool UWidgetStudioTestClass::TestGetControlDimensions | ( | ) |
Test getting current control dimensions by setting values and getting them through WS Subsystem function.
bool UWidgetStudioTestClass::TestGetIconSet | ( | ) |
Test getting current icon set by setting values and getting them through WS Subsystem function.
bool UWidgetStudioTestClass::TestGetTheme | ( | ) |
WSSubsystem Tests.
Test getting current theme by setting values and getting them through WS Subsystem function
bool UWidgetStudioTestClass::TestGetTypography | ( | ) |
Test getting current typography by setting values and getting them through WS Subsystem function.
bool UWidgetStudioTestClass::TestResetTheme | ( | ) |
Test ResetTheme() by passing in non-default values, then calling function, then testing to make sure new values match plugin defaults.
bool UWidgetStudioTestClass::TestSetBorderRadius | ( | ) |
Test setting border radius using WS Subsystem function, then retrieving it to make sure it was set properly.
bool UWidgetStudioTestClass::TestSetControlDimensions | ( | ) |
Test setting control dimensions using WS Subsystem function, then retrieving it to make sure it was set properly.
bool UWidgetStudioTestClass::TestSetIconSet | ( | ) |
Test setting icon set using WS Subsystem function, then retrieving it to make sure it was set properly.
bool UWidgetStudioTestClass::TestSetTheme | ( | ) |
Test setting theme using WS Subsystem function, then retrieving it to make sure it was set properly.
bool UWidgetStudioTestClass::TestSetTypography | ( | ) |
Test setting typography using WS Subsystem function, then retrieving it to make sure it was set properly.