logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.Ui.Tests.Editor

    Classes

    FontAssetCreatorTests

    EditMode tests for FontAssetCreator. Every test that writes an asset targets a private temp folder, so these tests stay hermetic regardless of what the project already has under DefaultOutputFolder. Mirrors GameSaveCreatorTests and UiSettingsCreatorTests.

    LoadingProgressPrefabGenerationPlanTests

    The plan the Generate LoadingProgress Prefabs window previews and the generator then carries out. A theme that already has a LoadingProgress prefab — every theme the Theme Builder generates has its own LoadingBar — is left alone unless the author opts into replacing, and the preview lists exactly which themes will be written, which will be replaced and which are kept.

    LoadingProgressThemeFixture

    The throwaway world the LoadingProgress generator tests run in: one folder per theme under a temporary root, each holding a copy of a shipped theme's real LabeledSlider prefab — and, for a theme that already has a loading bar, a copy of that theme's shipped LoadingBar prefab assigned as its template — so every variant the generator writes lands beside a copy and never inside the package.

    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.

    UnityUiInteractableComponentEditorObjectFieldTests

    The UI interactable component's inspector is the one place a field SHOULD take scene objects: its content wrapper, label, highlight, button, value and element fields point at GameObjects inside the component's own hierarchy. It still records a drop for Undo against the component. Driven through the inspector's real field-rendering path with IMGUI's object field replaced, since a batch run has no OnGUI pass.

    UnityUiLoadingProgressPrefabGeneratorReportTests

    The LoadingProgress generator's report must describe what is on disk after the run: every variant it wrote counts as created and gets assigned, a theme only appears under failures when something really failed, and a theme that already has a LoadingProgress prefab keeps it unless the author opted into replacing it — the report then says which themes were filled, replaced and kept.

    UnityUiSettingsEditorObjectFieldTests

    The UI Settings inspector's UI prefab field holds a prefab only and records a drop for Undo against the settings asset — a settings asset that kept a scene GameObject would lose the reference on save. Driven through the inspector's real field-rendering path with IMGUI's object field replaced, since a batch run has no OnGUI pass.

    UnityUiThemeDefinitionEditorObjectFieldTests

    The UI Theme Definition inspector's template fields hold prefabs only and record a drop for Undo against the theme: a theme asset that kept a scene object would lose the reference on save, and a drop that skipped the theme's undo record could not be taken back. Driven through the inspector's real field-rendering path with IMGUI's object field replaced, since a batch run has no OnGUI pass.

    In this article
    © 2026 Serenity. All Rights Reserved