logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.UnityValidation.Tests.Editor

    Classes

    AdoptedAssetKeyIndexTests

    Pure tests for Serenity.Global.Infrastructure.Editor.Validation.AdoptedAssetKeyIndex — no AssetDatabase, no assets on disk; BuildAddress is a string operation, so Serenity.Global.Infrastructure.Editor.Validation.AdoptedAssetKeyIndex.FromPathPairs(System.Collections.Generic.IEnumerable{System.ValueTuple{System.String,System.String}}) never consults the Addressables group.

    AssetPathFieldReflectionTests

    Tests for Serenity.Global.Infrastructure.Editor.Validation.AssetPathFieldReflection: a top-level match, a depth-1 nested match, a list-element match (Array.data[N] path), a depth-2 field that must never be recursed into, and a [NonSerialized] field that must be skipped even though it carries the attribute.

    FoundationReferenceContractsTests

    Anti-drift tests for FoundationReferenceContracts: every row must name a real owner type, a serialized property that actually resolves on a scratch instance of it, and (when fixed) a real referenced type implementing IFoundationSettings — the same guarantee GameSettingWiringMap's own field-reflection test gives its narrower table. Owner types are resolved purely by name (GetTypeFromCurrentDomainAssemblies(string)), so this assembly needs no reference to Menu, Modal, GameSettings, Leaderboard, Achievements, Feedback, GameGraphics, Localization or EventDispatcher — exactly the decoupling SerenityDiscoveryRegistry already relies on.

    FoundationReferenceIndexTests

    Tests for Serenity.Global.Infrastructure.Editor.Validation.FoundationReferenceIndex: the shipped-asset-to-adopted-counterpart pairing rule, and the two resolve maps (Id, Guid) it derives from that pairing. Fixtures live under a scratch folder nested inside Serenity.Global.Infrastructure.Editor.SerenityEditorPaths.AssetsRoot (so Serenity.Global.Infrastructure.Editor.Validation.FoundationAssetOwnership.IsProjectOwnedPath(System.String) classifies it as shipped/package content, exactly like a real Serenity install) and a scratch folder outside it (project-owned/adopted), mirroring SystemAdoptionRunnerTests's own scratch-root pattern.

    FoundationReferenceWalkerTests

    Tests for Serenity.Global.Infrastructure.Editor.Validation.FoundationReferenceWalker's AssetKey support: a type with no declared FoundationReferenceContracts row but at least one [AssetPathField] field must still be walked, emitting one Serenity.Global.Infrastructure.Editor.Validation.FoundationReferenceSite per match with AssetKey and the attribute's asset type resolved.

    SerenityAddressableKeyValidatorTests

    Tests for Serenity.Global.Infrastructure.Editor.Validation.SerenityAddressableKeyValidator: an AssetPathFieldAttribute-annotated string field that stores a raw Assets/... path to an Addressable-eligible target must be flagged as an error, a key already matching a registered address must not, an unresolvable non-path key must be a warning rather than an error, and the fix API must resolve the raw-path case.

    SerenityAddressableTagValidatorTests

    Tests for Serenity.Global.Infrastructure.Editor.Validation.SerenityAddressableTagValidator: a Serenity asset that should be Addressable per UnityAddressablesLabeler's own rules but isn't must be flagged, and the fix API must resolve it.

    SerenityAdoptedReferenceValidatorTests

    Tests for Serenity.Global.Infrastructure.Editor.Validation.SerenityAdoptedReferenceValidator. Fixtures follow FoundationReferenceIndexTests's scratch-root split: a "shipped" fixture lives under Serenity.Global.Infrastructure.Editor.SerenityEditorPaths.AssetsRoot, a project-owned/adopted one outside it.

    SerenityAssetReferenceFinderTests

    Tests for Serenity.Global.Infrastructure.Editor.Validation.References.SerenityAssetReferenceFinder: finding ScriptableObject references to a target asset, and nulling them out once that target asset has been deleted.

    SerenityAudioRegistrationValidatorTests

    Tests for Serenity.Global.Infrastructure.Editor.Validation.SerenityAudioRegistrationValidator: an audio clip definition that exists as an asset but is absent from its selectable game-settings registry must be flagged, and the fix API must resolve it. Builds a throwaway registry via ScriptableObject.CreateInstance(string) because UnityGameSettingsDefinition has no assembly definition of its own — see Serenity.Global.Infrastructure.Editor.Validation.SerenityAudioRegistrationValidator's class remarks — and targets it explicitly through the two-registry FixByRegistering overload so the test never touches the project's real Audio_SoundToTrigger asset.

    SerenityBrandingValidatorTests

    Tests for Serenity.Global.Infrastructure.Editor.Validation.SerenityBrandingValidator. The scan is pure System.IO (mirrors production), so fixtures are raw files written directly under Assets and removed with Directory.Delete — never through AssetDatabase — so Unity never imports or compiles them during the test.

    SerenityHealthCheckValidatorTestSettings

    A throwaway IFoundationSettings asset type for SerenityHealthCheckValidatorTests. Lives in its own same-named file so Unity can bind its script when the tests create it as an asset (mirrors SerenityAssetIdLookupTestSettings). Deliberately not shared with any other suite — see that type's docstring for why.

    SerenityHealthCheckValidatorTests

    Tests for Serenity.Global.Infrastructure.Editor.Validation.SerenityHealthCheckValidator.Run(Serenity.Global.Infrastructure.Editor.Validation.SerenityValidationReport)'s ownership-aware duplicate-Id read: a shipped asset shadowed by a project-owned clone with the same Id is an Info finding, not an Error, while a genuine duplicate (both package content, or both project-owned) stays an Error. Every fixture is a real SerenityHealthCheckValidatorTestSettings asset on disk — Serenity.Global.Infrastructure.Editor.Validation.SerenityHealthCheckValidator.LoadFoundationAssets is a project-wide AssetDatabase scan, so nothing here can be faked in-memory.

    SerenityProjectValidationRunnerTests

    Smoke tests for RunAll(string) against the real project. Exact issue counts depend on project state, so these assert structure (validators ran, JSON parses) rather than counts.

    SerenityValidationReportTests

    Tests for Serenity.Global.Infrastructure.Editor.Validation.SerenityValidationReport.ToJson — the machine-readable validation result an agent reads to confirm a project is wired correctly. The report's JSON DTOs are private, so these tests parse the JSON into local mirror types and assert on content.

    In this article
    © 2026 Serenity. All Rights Reserved