logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class HudAnimationSequenceLayerInspectorCacheTests

    EditMode tests for HudAnimationSequenceLayerInspector's per-layer cached UnityEditor.SerializedObject: the fake-null eviction guard in GetSerializedLayer, and every public accessor built on top of it, must never throw Exception when the wrapped layer instance goes Unity-fake-null out from under the cache.

    Inheritance
    object
    HudAnimationSequenceLayerInspectorCacheTests
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.GameUi.Tests.Editor.Builder
    Assembly: Serenity.GameUi.Tests.Editor.dll
    Syntax
    public class HudAnimationSequenceLayerInspectorCacheTests
    Remarks

    Follows the create-instance / destroy-immediate / re-fetch shape HudElementThresholdDefaultsTests uses for its own UnityEngine.ScriptableObject fixtures. GetSerializedLayer's own null guard (if (layer == null) return null;) runs before the dictionary lookup, and Unity's "fake null" equality means a destroyed instance already reads as == null at that guard — so re-querying with the SAME destroyed reference is the directly reachable, black-box-testable slice of the eviction path: it proves the null guard the class relies on actually holds, so nothing downstream (the dictionary lookup, cached.targetObject) is ever reached with a stale wrapper. The internal TryGetValue-finds-a-stale-entry branch this guards is otherwise only reachable across an actual domain reload, which an EditMode test cannot simulate.

    Constructors

    HudAnimationSequenceLayerInspectorCacheTests()

    Declaration
    public HudAnimationSequenceLayerInspectorCacheTests()

    Methods

    GetSerializedLayer_ANewInstanceAfterAPriorOneWasDestroyed_StillReturnsAFreshUsableWrapper()

    Declaration
    public void GetSerializedLayer_ANewInstanceAfterAPriorOneWasDestroyed_StillReturnsAFreshUsableWrapper()

    GetSerializedLayer_AfterDestroyImmediate_RecoversWithoutThrowing()

    Declaration
    public void GetSerializedLayer_AfterDestroyImmediate_RecoversWithoutThrowing()

    GetSerializedLayer_LiveInstance_ReturnsAUsableWrapper()

    Declaration
    public void GetSerializedLayer_LiveInstance_ReturnsAUsableWrapper()

    GetStepsProperty_AfterDestroyImmediate_ReturnsNullWithoutThrowing()

    Declaration
    public void GetStepsProperty_AfterDestroyImmediate_ReturnsNullWithoutThrowing()

    GetTransformId_AfterDestroyImmediate_ReturnsEmptyWithoutThrowing()

    Declaration
    public void GetTransformId_AfterDestroyImmediate_ReturnsEmptyWithoutThrowing()

    TearDown()

    Declaration
    public void TearDown()
    In this article
    © 2026 Serenity. All Rights Reserved