Widget Studio
UWidgetStudioTestClass Class Reference

Test class to perform unit tests. More...

#include <WSTestClass.h>

Inheritance diagram for UWidgetStudioTestClass:

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

UWidgetStudioSubsystemWSSubsystem = nullptr
 
TSoftObjectPtr< UWidgetStudioThemeNordDarkTheme
 
TSoftObjectPtr< UWidgetStudioThemeNordLightTheme
 
TSoftObjectPtr< UWidgetStudioIconSetDefaultIconSet
 
TSoftObjectPtr< UWidgetStudioIconSetTestIconSet
 
TSoftObjectPtr< UWidgetStudioTypographyOpenSansTypography
 
TSoftObjectPtr< UWidgetStudioTypographyTestTypography
 

Detailed Description

Test class to perform unit tests.

Member Function Documentation

◆ FuncLibTestConstructFontInfoFromStyle()

bool UWidgetStudioTestClass::FuncLibTestConstructFontInfoFromStyle ( )
static

Test ConstructFontInfoFromStyle() by comparing hard-coded font to font retrieved from function.

Returns
true if pass, false if fail

◆ FuncLibTestConstructFontInfoFromTypography()

bool UWidgetStudioTestClass::FuncLibTestConstructFontInfoFromTypography ( )
static

Test ConstructFontInfoFromTypography() by comparing hard-coded font to font retrieved from function.

Returns
true if pass, false if fail

◆ FuncLibTestContainsNumbers()

bool UWidgetStudioTestClass::FuncLibTestContainsNumbers ( )
static

Test ContainsNumbers() by running func on two strings; one with number, one without number.

Returns
true if pass, false if fail

◆ FuncLibTestFilterByCharacterLimit()

bool UWidgetStudioTestClass::FuncLibTestFilterByCharacterLimit ( )
static

Test FilterByCharacterLimit() by comparing manually truncated string to result of function.

Returns
true if pass, false if fail

◆ FuncLibTestGetBorderRadius()

bool UWidgetStudioTestClass::FuncLibTestGetBorderRadius ( )

Test getting current border radius by setting values and getting them through func lib function.

Returns
true if pass, false if fail

◆ FuncLibTestGetColorBasedValue()

bool UWidgetStudioTestClass::FuncLibTestGetColorBasedValue ( )
static

Test getting color-based value from each part of the value range.

Returns
true if pass, false if fail

◆ FuncLibTestGetColorFromPalette()

bool UWidgetStudioTestClass::FuncLibTestGetColorFromPalette ( )
static

WSFunctionLibrary Tests.

Test getting color from palette with variable, constant, and invalid cases

Returns
true if pass, false if fail

◆ FuncLibTestGetControlDimensions()

bool UWidgetStudioTestClass::FuncLibTestGetControlDimensions ( )

Test getting current control dimensions by setting values and getting them through func lib function.

Returns
true if pass, false if fail

◆ FuncLibTestGetCurrentIconSet()

bool UWidgetStudioTestClass::FuncLibTestGetCurrentIconSet ( )

Test getting current icon set by setting values and getting them through func lib function.

Returns
true if pass, false if fail

◆ FuncLibTestGetCurrentTheme()

bool UWidgetStudioTestClass::FuncLibTestGetCurrentTheme ( )

Test getting current theme by setting values and getting them through func lib function.

Returns
true if pass, false if fail

◆ FuncLibTestGetCurrentTypography()

bool UWidgetStudioTestClass::FuncLibTestGetCurrentTypography ( )

Test getting current typography by setting values and getting them through func lib function.

Returns
true if pass, false if fail

◆ FuncLibTestGetFontWeightName()

bool UWidgetStudioTestClass::FuncLibTestGetFontWeightName ( )
static

Test GetFontWeightName() by comparing hard-coded font to font retrieved from function.

Returns
true if pass, false if fail

◆ FuncLibTestGetPaletteBasedValue()

bool UWidgetStudioTestClass::FuncLibTestGetPaletteBasedValue ( )
static

Test getting palette-based value from each part of the value range.

Returns
true if pass, false if fail

◆ FuncLibTestGetRoundedBackgroundMaterial()

bool UWidgetStudioTestClass::FuncLibTestGetRoundedBackgroundMaterial ( )
static

Test InterpBrushImageSize by calling function on one widget and doing interp manually on another, then comparing the results.

Returns
true if pass, false if fail Test getting background material by setting it, then retrieving it
true if pass, false if fail

◆ FuncLibTestGetRoundedOutlineMaterial()

bool UWidgetStudioTestClass::FuncLibTestGetRoundedOutlineMaterial ( )
static

Test getting rounded outline material by setting it, then retrieving it.

Returns
true if pass, false if fail

◆ FuncLibTestGetRoundedShadowMaterial()

bool UWidgetStudioTestClass::FuncLibTestGetRoundedShadowMaterial ( )
static

Test getting rounded shadow material by setting it, then retrieving it.

Returns
true if pass, false if fail

◆ FuncLibTestGetSizeByModifier()

bool UWidgetStudioTestClass::FuncLibTestGetSizeByModifier ( )
static

Test GetSizeByModifier() by comparing hard-coded value to result of calling function.

Returns
true if pass, false if fail

◆ FuncLibTestGetTextureFromIconLibrary()

bool UWidgetStudioTestClass::FuncLibTestGetTextureFromIconLibrary ( )
static

Test getting texture from icon library using current EIconItem:Bookmark.

Returns
true if pass, false if fail

◆ FuncLibTestGetTypefaceFromTypography()

bool UWidgetStudioTestClass::FuncLibTestGetTypefaceFromTypography ( )
static

Test getting typeface from typography by getting the value manually, then calling the function, then comparing results.

Returns
true if pass, false if fail

◆ FuncLibTestGetTypeScaleFromTypography()

bool UWidgetStudioTestClass::FuncLibTestGetTypeScaleFromTypography ( )
static

Test GetTypeScaleFromTypography() by comparing hard-coded font to font retrieved from function.

Returns
true if pass, false if fail

◆ FuncLibTestInterpEditableTextBoxColor()

bool UWidgetStudioTestClass::FuncLibTestInterpEditableTextBoxColor ( ) const

Test InterpEditableTextBoxColor by calling function on one widget and doing interp manually on another, then comparing the results.

Returns
true if pass, false if fail

◆ FuncLibTestInterpImageColor()

bool UWidgetStudioTestClass::FuncLibTestInterpImageColor ( ) const

Test InterpImageColor by calling function on one widget and doing interp manually on another, then comparing the results.

Returns
true if pass, false if fail

◆ FuncLibTestInterpSizeBoxMinOverrides()

bool UWidgetStudioTestClass::FuncLibTestInterpSizeBoxMinOverrides ( ) const

Test InterpSizeBoxMinOverrides by calling function on one widget and doing interp manually on another, then comparing the results.

Returns
true if pass, false if fail

◆ FuncLibTestInterpSizeBoxOverrides()

bool UWidgetStudioTestClass::FuncLibTestInterpSizeBoxOverrides ( ) const

Test InterpSizeBoxOverrides by calling function on one widget and doing interp manually on another, then comparing the results.

Returns
true if pass, false if fail

◆ FuncLibTestInterpTextColor()

bool UWidgetStudioTestClass::FuncLibTestInterpTextColor ( ) const

Test InterpTextColor by calling function on one widget and doing interp manually on another, then comparing the results.

Returns
true if pass, false if fail

◆ FuncLibTestInterpWidgetColor()

bool UWidgetStudioTestClass::FuncLibTestInterpWidgetColor ( ) const

Test InterpWidgetColor by calling function on one widget and doing interp manually on another, then comparing the results.

Returns
true if pass, false if fail

◆ FuncLibTestInterpWidgetOpacity()

bool UWidgetStudioTestClass::FuncLibTestInterpWidgetOpacity ( ) const

Test InterpWidgetOpacity by calling function on one widget and doing interp manually on another, then comparing the results.

Returns
true if pass, false if fail

◆ FuncLibTestInterpWidgetRotation()

bool UWidgetStudioTestClass::FuncLibTestInterpWidgetRotation ( ) const

Test InterpWidgetRotation by calling function on one widget and doing interp manually on another, then comparing the results.

Returns
true if pass, false if fail

◆ FuncLibTestInterpWidgetScale()

bool UWidgetStudioTestClass::FuncLibTestInterpWidgetScale ( ) const

Test InterpWidgetScale by calling function on one widget and doing interp manually on another, then comparing the results.

Returns
true if pass, false if fail

◆ FuncLibTestInterpWidgetTranslation()

bool UWidgetStudioTestClass::FuncLibTestInterpWidgetTranslation ( ) const

Test InterpWidgetTranslation by calling function on one widget and doing interp manually on another, then comparing the results.

Returns
true if pass, false if fail

◆ FuncLibTestSetIconSet()

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

Returns
true if pass, false if fail

◆ FuncLibTestSetTheme()

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

Returns
true if pass, false if fail

◆ FuncLibTestSetTypography()

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

Returns
true if pass, false if fail

◆ PerformAllTests()

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

◆ TestGetBorderRadius()

bool UWidgetStudioTestClass::TestGetBorderRadius ( )

Test getting current border radius by setting values and getting them through WS Subsystem function.

Returns
true if pass, false if fail

◆ TestGetControlDimensions()

bool UWidgetStudioTestClass::TestGetControlDimensions ( )

Test getting current control dimensions by setting values and getting them through WS Subsystem function.

Returns
true if pass, false if fail

◆ TestGetIconSet()

bool UWidgetStudioTestClass::TestGetIconSet ( )

Test getting current icon set by setting values and getting them through WS Subsystem function.

Returns
true if pass, false if fail

◆ TestGetTheme()

bool UWidgetStudioTestClass::TestGetTheme ( )

WSSubsystem Tests.

Test getting current theme by setting values and getting them through WS Subsystem function

Returns
true if pass, false if fail

◆ TestGetTypography()

bool UWidgetStudioTestClass::TestGetTypography ( )

Test getting current typography by setting values and getting them through WS Subsystem function.

Returns
true if pass, false if fail

◆ TestResetTheme()

bool UWidgetStudioTestClass::TestResetTheme ( )

Test ResetTheme() by passing in non-default values, then calling function, then testing to make sure new values match plugin defaults.

Returns
true if pass, false if fail

◆ TestSetBorderRadius()

bool UWidgetStudioTestClass::TestSetBorderRadius ( )

Test setting border radius using WS Subsystem function, then retrieving it to make sure it was set properly.

Returns
true if pass, false if fail

◆ TestSetControlDimensions()

bool UWidgetStudioTestClass::TestSetControlDimensions ( )

Test setting control dimensions using WS Subsystem function, then retrieving it to make sure it was set properly.

Returns
true if pass, false if fail

◆ TestSetIconSet()

bool UWidgetStudioTestClass::TestSetIconSet ( )

Test setting icon set using WS Subsystem function, then retrieving it to make sure it was set properly.

Returns
true if pass, false if fail

◆ TestSetTheme()

bool UWidgetStudioTestClass::TestSetTheme ( )

Test setting theme using WS Subsystem function, then retrieving it to make sure it was set properly.

Returns
true if pass, false if fail

◆ TestSetTypography()

bool UWidgetStudioTestClass::TestSetTypography ( )

Test setting typography using WS Subsystem function, then retrieving it to make sure it was set properly.

Returns
true if pass, false if fail

The documentation for this class was generated from the following files: