Class UiSettingsCreatorTests
EditMode tests for UiSettingsCreator: field validation and, in a temporary folder, actual
settings asset creation — including the create-vs-update singleton contract and
EnsureSettings(string, bool, string)'s found/created/error outcomes. Every fixture uses an
explicit Serenity.Ui.Tests.Editor.UiSettingsCreatorTests.TempFolder and either an explicit new-asset path, an explicit
UiSettingsCreator.Input.ExistingSettingsAssetPath, or — for
EnsureSettings(string, bool, string) — its searchRootFolder test seam, so these tests
stay hermetic even though the package ships its own real singleton at
Assets/Serenity/Media/Ui/UiSettings.asset; that asset is never touched here. Mirrors
Serenity.Menu.Tests.Editor.MenuServiceSettingsCreatorTests.
Inherited Members
Namespace: Serenity.Ui.Tests.Editor
Assembly: Tests.Editor.dll
Syntax
public class UiSettingsCreatorTests
Constructors
UiSettingsCreatorTests()
Declaration
public UiSettingsCreatorTests()
Methods
ApplyFields_EveryAssetFieldHasALikeNamedInputFieldOrIsExplicitlyExcluded()
Declaration
public void ApplyFields_EveryAssetFieldHasALikeNamedInputFieldOrIsExplicitlyExcluded()
CreateFromDraft_Existing_CopiesObjectReferenceFieldsOntoTheRealAssetAndPreservesGuid()
Declaration
public void CreateFromDraft_Existing_CopiesObjectReferenceFieldsOntoTheRealAssetAndPreservesGuid()
CreateFromDraft_NoExisting_CreatesAtTheGivenPath()
Declaration
public void CreateFromDraft_NoExisting_CreatesAtTheGivenPath()
Create_AssignsAGuid()
Declaration
public void Create_AssignsAGuid()
Create_CaseVariantIdInADifferentFolder_IsRefused()
Case variant of the above — the runtime resolution this guards against does not care about letter case any more than it cares about which folder the duplicate lives in.
Declaration
public void Create_CaseVariantIdInADifferentFolder_IsRefused()
Create_DuplicateIdInADifferentFolder_IsRefused()
The runtime resolves this singleton by Id project-wide, so a duplicate in a DIFFERENT folder than
this run's own output folder must block, not just one sitting in the same folder. Uses a private Id
(not the shared default "UiSettings") so this stays independent of the package's own shipped
singleton at Assets/Serenity/Media/Ui/UiSettings.asset.
Declaration
public void Create_DuplicateIdInADifferentFolder_IsRefused()
Create_ExistingAsset_LeavesPrewarmLabelsAndAddressesUntouched()
Declaration
public void Create_ExistingAsset_LeavesPrewarmLabelsAndAddressesUntouched()
Create_Existing_EditsInPlace()
Declaration
public void Create_Existing_EditsInPlace()
Create_FailureRollsBack()
Forces a genuine failure the same way SettingsAssetAuthoring.VerifyAssetWasWrittenToDisk's own
doc comment describes: a folder Unity's AssetDatabase cache still reports as valid, but that
has actually been removed from disk directly. Mirrors MenuServiceSettingsCreatorTests' and
SoundMixerSettingsCreatorTests' identical regression test.
Declaration
public void Create_FailureRollsBack()
Create_FreshAsset_KeepsTheThreeDefaultFontSizePresets()
Declaration
public void Create_FreshAsset_KeepsTheThreeDefaultFontSizePresets()
Create_NoExisting_CreatesAtTheGivenPath()
Declaration
public void Create_NoExisting_CreatesAtTheGivenPath()
Create_RegisterAsAddressablesFalse_NoAddressablesPollution()
Declaration
public void Create_RegisterAsAddressablesFalse_NoAddressablesPollution()
Create_UpdateKeepingItsOwnId_IsNotTreatedAsADuplicate()
An update-in-place run keeping (or renaming to) an Id no OTHER asset holds must never trip the project-wide duplicate check on itself.
Declaration
public void Create_UpdateKeepingItsOwnId_IsNotTreatedAsADuplicate()
Create_UpdateRunAgainstAnExistingAsset_DoesNotCreateTheOutputFolder()
Declaration
public void Create_UpdateRunAgainstAnExistingAsset_DoesNotCreateTheOutputFolder()
Create_WritesInitialViewIdThemeAndUiRoot()
Declaration
public void Create_WritesInitialViewIdThemeAndUiRoot()
EnsureSettings_NoneExists_CreatesOneWithDefaults()
Declaration
public void EnsureSettings_NoneExists_CreatesOneWithDefaults()
EnsureSettings_OneExists_ReturnsItWithoutMutating()
Scopes the singleton scan to Serenity.Ui.Tests.Editor.UiSettingsCreatorTests.TempFolder via searchRootFolder so this test's own
fixture is the only UnityUiSettings asset the scan can see — without that seam this
would collide with the package's shipped singleton at Assets/Serenity/Media/Ui/UiSettings.asset
and the project would (correctly) need exactly one UnityUiSettings asset in total for
this test to be deterministic. Asserts the found asset is returned untouched, not recreated.
Declaration
public void EnsureSettings_OneExists_ReturnsItWithoutMutating()
Input_DefaultExistingSettingsAssetPath_IsEmpty()
Drift guard for Create(Input)'s write-mode selection: a default, otherwise-untouched UiSettingsCreator.Input must select CreateNew, never UpdateExisting — a non-empty default on ExistingSettingsAssetPath would silently repoint every caller that forgets to clear it at an update.
Declaration
public void Input_DefaultExistingSettingsAssetPath_IsEmpty()
OneTimeTearDown()
Declaration
public void OneTimeTearDown()
SetUp()
Declaration
public void SetUp()
TearDown()
Declaration
public void TearDown()
Validate_RejectsEmptyId()
Declaration
public void Validate_RejectsEmptyId()
Validate_RejectsNonPositiveFloatIncrement()
Declaration
public void Validate_RejectsNonPositiveFloatIncrement()
Validate_WarnsWhenNoThemeAssigned()
Declaration
public void Validate_WarnsWhenNoThemeAssigned()