logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityCharacterPoolServiceTests

    PlayMode tests for UnityCharacterPoolService, the MonoBehaviour pool. A real prefab (GameObject with an IViewBase component) is supplied so the full spawn / release / reuse path can run. Bind delegates are simple counting lambdas.

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

    Constructors

    UnityCharacterPoolServiceTests()

    Declaration
    public UnityCharacterPoolServiceTests()

    Methods

    ActiveCount_Initially_IsZero()

    Declaration
    public void ActiveCount_Initially_IsZero()

    Implements_ICharacterKeyResolver()

    Declaration
    public void Implements_ICharacterKeyResolver()

    Implements_ICharacterSpawnService()

    Declaration
    public void Implements_ICharacterSpawnService()

    Initialize_NullBind_Throws()

    Declaration
    public void Initialize_NullBind_Throws()

    Initialize_NullRebind_Throws()

    Declaration
    public void Initialize_NullRebind_Throws()

    Initialize_NullUnbind_Throws()

    Declaration
    public void Initialize_NullUnbind_Throws()

    ReleaseAll_ClearsActiveCount()

    Declaration
    public void ReleaseAll_ClearsActiveCount()

    ReleaseAll_Empty_DoesNotThrow()

    Declaration
    public void ReleaseAll_Empty_DoesNotThrow()

    Release_InvalidId_DoesNothing()

    Declaration
    public void Release_InvalidId_DoesNothing()

    Release_UnknownId_DoesNothing()

    Declaration
    public void Release_UnknownId_DoesNothing()

    SetUp()

    Declaration
    public void SetUp()

    SpawnThenRelease_ReturnsToPool_AndReuseRebinds()

    Declaration
    public void SpawnThenRelease_ReturnsToPool_AndReuseRebinds()

    Spawn_AppliesPositionToInstance()

    Declaration
    public void Spawn_AppliesPositionToInstance()

    Spawn_BindFails_LogsErrorAndReturnsDefault()

    Declaration
    public void Spawn_BindFails_LogsErrorAndReturnsDefault()

    Spawn_CharacterWhosePrefabHasNoCharacterView_RefusesWithOneWarningNamingTheCharacterAndThePrefab()

    The pool shows every instance through the prefab's Character View. A prefab without one used to throw on the first spawn — inside a wave's spawn coroutine, which killed the wave. It is refused instead: no instance, one warning naming the character, the prefab and the component to add, however many times it is asked for.

    Declaration
    public void Spawn_CharacterWhosePrefabHasNoCharacterView_RefusesWithOneWarningNamingTheCharacterAndThePrefab()

    Spawn_NullPrefab_LogsErrorAndReturnsDefault()

    Declaration
    public void Spawn_NullPrefab_LogsErrorAndReturnsDefault()

    Spawn_Registered_CreatesInstanceAndReturnsValidId()

    Declaration
    public void Spawn_Registered_CreatesInstanceAndReturnsValidId()

    Spawn_UnregisteredKey_LogsErrorAndReturnsDefault()

    Declaration
    public void Spawn_UnregisteredKey_LogsErrorAndReturnsDefault()

    TearDown()

    Declaration
    public void TearDown()

    TryResolveCharacterKey_KeyNobodyRegistered_DoesNotResolve()

    Declaration
    public void TryResolveCharacterKey_KeyNobodyRegistered_DoesNotResolve()

    TryResolveCharacterKey_NothingAuthored_DoesNotResolve()

    Declaration
    public void TryResolveCharacterKey_NothingAuthored_DoesNotResolve()

    TryResolveCharacterKey_PrefabARegisteredCharacterNames_ReturnsThatCharactersKey()

    Declaration
    public void TryResolveCharacterKey_PrefabARegisteredCharacterNames_ReturnsThatCharactersKey()

    TryResolveCharacterKey_PrefabNoRegisteredCharacterNames_DoesNotResolve()

    Declaration
    public void TryResolveCharacterKey_PrefabNoRegisteredCharacterNames_DoesNotResolve()

    TryResolveCharacterKey_RegisteredCharactersConfig_ReturnsItsKey()

    Declaration
    public void TryResolveCharacterKey_RegisteredCharactersConfig_ReturnsItsKey()

    TryResolveCharacterKey_RegisteredKey_ResolvesToItself()

    Declaration
    public void TryResolveCharacterKey_RegisteredKey_ResolvesToItself()

    TryResolveCharacterKey_ThreeCharactersNameTheSamePrefab_EveryWarningNamesTheCharacterThatWins()

    Declaration
    public void TryResolveCharacterKey_ThreeCharactersNameTheSamePrefab_EveryWarningNamesTheCharacterThatWins()

    TryResolveCharacterKey_TwoCharactersNameTheSamePrefab_ReturnsTheKeyThatSortsFirst()

    Declaration
    public void TryResolveCharacterKey_TwoCharactersNameTheSamePrefab_ReturnsTheKeyThatSortsFirst()

    TryResolveCharacterKey_TwoCharactersNameTheSamePrefab_WarnsOnceNamingBothCharactersAndThePrefab()

    Declaration
    public void TryResolveCharacterKey_TwoCharactersNameTheSamePrefab_WarnsOnceNamingBothCharactersAndThePrefab()

    TrySpawn_CharacterWhosePrefabHasNoCharacterView_ReturnsARefusalThePoolAlreadyReported()

    A caller that forfeits a refused character must know the pool already said why, or it writes a second line for the same cause — every refusal the pool makes is one it reported.

    Declaration
    public void TrySpawn_CharacterWhosePrefabHasNoCharacterView_ReturnsARefusalThePoolAlreadyReported()

    TrySpawn_KeyNobodyRegistered_ReturnsARefusalThePoolAlreadyReported()

    Declaration
    public void TrySpawn_KeyNobodyRegistered_ReturnsARefusalThePoolAlreadyReported()

    TrySpawn_RegisteredCharacter_ReturnsTheSpawnedCharactersIdentity()

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