logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class HudAnimatorBuilderTests

    Characterization tests for HudAnimatorBuilder's per-entry authoring edges, constructed directly against a fake host — UnityHudHostComponentAnimatorTests covers the shared animator's build/teardown lifecycle, but never an authored entry with no layer asset, an ON_SIGNAL entry whose named signal actually fires, or two elements whose different trigger kinds must each drive only their own authored layer. Direct construction is possible because Serenity.UnityGameUi.Infrastructure grants InternalsVisibleTo to this test assembly.

    Inheritance
    object
    HudAnimatorBuilderTests
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.UnityGameUi.Tests.Infrastructure
    Assembly: Tests.dll
    Syntax
    public class HudAnimatorBuilderTests

    Constructors

    HudAnimatorBuilderTests()

    Declaration
    public HudAnimatorBuilderTests()

    Methods

    BuildAnimator_ElementAnimationWithNoLayerAsset_StillBuildsAnAnimatorWithNothingConfigured()

    A genuine surprise, found by this test: BuildAnimator flags anyAnimations = true as soon as an element's Animations list is non-empty — before it ever checks whether any entry in that list actually carries a layer asset. An element authoring one assetless entry therefore still pays for the shared ProceduralAnimatorComponent to be built (with zero configured layers), unlike an element with no Animations entries at all, which correctly never builds one — see ShowHud_HudWithNoAnimatedElements_NeverBuildsAnAnimator(). This test documents the actual behavior rather than the (wrong) assumption that the two cases were equivalent — it pins current behaviour, not desired behaviour, for a later fix.

    Declaration
    public void BuildAnimator_ElementAnimationWithNoLayerAsset_StillBuildsAnAnimatorWithNothingConfigured()

    BuildAnimator_OnSignalAnimationWithUnresolvableSignalTypeName_BuildsTheAnimatorWithoutThrowingOrEverActivating()

    Declaration
    public void BuildAnimator_OnSignalAnimationWithUnresolvableSignalTypeName_BuildsTheAnimatorWithoutThrowingOrEverActivating()

    BuildAnimator_OnSignalAnimation_ActivatesItsLayerWhenTheNamedSignalIsDispatched()

    Declaration
    public void BuildAnimator_OnSignalAnimation_ActivatesItsLayerWhenTheNamedSignalIsDispatched()

    BuildAnimator_TwoElementsWithDifferentTriggerKinds_EachActivatesOnlyItsOwnAuthoredLayer()

    Not observable through UnityHudHostComponent's public surface before this suite could construct HudAnimatorBuilder directly: two elements, each authoring one entry of a different trigger kind and each with its own layer, must each drive only their own authored layer — an ON_SIGNAL entry never activates a different element's layer, and a value-triggered entry fires only on its own owner's watched value actually changing.

    Declaration
    public void BuildAnimator_TwoElementsWithDifferentTriggerKinds_EachActivatesOnlyItsOwnAuthoredLayer()

    SetUp()

    Declaration
    public void SetUp()

    TearDown()

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