logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.Localization.Tests.Editor

    Classes

    LocalizationAddressablesTestCleanup

    Removes the Addressables groups and labels Unity Localization's own package machinery auto-creates per locale, which live under Assets/AddressableAssetsData rather than any fixture's own temp folder and so survive that fixture's path-prefix Addressables-entry sweep entirely. Shared by every Localization editor test fixture that registers ephemeral locales, and by the pattern-based sweeps in LocalizationEphemeralGroupGuard and LocalizationTestGroupLeakSentinel, so the cleanup is written once instead of copied per file.

    LocalizationEphemeralGroupGuard

    Kills the per-locale Addressables groups and labels Unity Localization creates for a fixture's pseudo-locale codes as soon as they materialize. Unity Localization registers a collection's tables into Addressables from its asset postprocessor (ImportCollectionIntoProject), so the creation rides the asset import pipeline and lands whenever an import batch flushes — after the creating fixture's [TearDown] and even after the namespace-level LocalizationTestGroupLeakSentinel has already run. Synchronous teardown cleanup therefore sweeps before the groups exist and never sees them.

    LocalizationKeyValidatorFixtureDefinition

    Minimal ScriptableObject fixture that exercises the IsTranslating<Field> convention consumed by SerenityLocalizationKeyValidator, without depending on any shipped Serenity asset type.

    LocalizationTestGroupLeakSentinel

    Assembly-level safety net for the per-locale Addressables groups and labels Unity Localization auto-creates for every fixture locale these tests register (see LocalizationAddressablesTestCleanup and LocalizationEphemeralGroupGuard). A [SetUpFixture] at the namespace root, so each hook runs exactly once per test run — once before the first test in this namespace tree, and once after the last — not once per test. The setup sweep is silent (leftovers may predate the fix or come from an aborted run); the teardown sweep fails loudly so a fixture that stops cleaning up turns into a suite failure instead of silent working-tree pollution.

    SerenityHubStatusTests

    EditMode tests for the Slice 6.4 migration: BuildRows()'s wiring-health row no longer triggers SerenityProjectValidationRunner.RunAll synchronously — it reads SerenityHubValidationCache instead (spec §3 non-functional requirement; design ADR-7).

    SerenityLocalizationKeyValidatorPerLocaleTests

    EditMode tests for the per-locale empty-translation reporting added to Run(SerenityValidationReport, bool). Every fixture lives under a private temp folder and uses fixture-only locale codes (never "en"/"es", which the shipped project already registers globally) so these tests stay hermetic regardless of what the project already ships — mirrors the discipline in LocalizationSettingsCreatorTests.

    UnityLocalizationLocaleEditorUtilsTests

    EditMode tests for the selected-locale helpers on Serenity.Global.Infrastructure.Editor.UnityLocalizationLocaleEditorUtils. Mutates the project's real LocalizationSettings.SelectedLocale (there is no sandboxed equivalent for this global piece of state), so every test captures it in SetUp() and restores it in TearDown() — the same non-pollution discipline the Addressables fixtures follow.

    In this article
    © 2026 Serenity. All Rights Reserved