logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class AggregateCatalogTests

    EditMode tests for Discover(): the reflection-based aggregate discovery that every other Service Extension Creator piece relies on. Asserts against the live project catalog rather than a fake one, since discovery is inherently a scan over loaded assemblies.

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

    Constructors

    AggregateCatalogTests()

    Declaration
    public AggregateCatalogTests()

    Methods

    Discover_AssetPrefetcherHasConcreteTypeButNoVirtualMembers()

    AssetPrefetcher was not in the Phase 0 virtualization sweep's target list — it has a concrete UnityAssetPrefetcherService but zero public virtual members, unlike Combo/Score/etc. This is exactly the state ServiceExtensionCreator.Validate must block the Infrastructure base for (see ServiceExtensionCreatorValidationTests.Validate_RejectsInfrastructureForAggregateWithoutVirtualMembers); pinning the descriptor-level fact here means that end-to-end test's premise can't silently drift.

    Declaration
    public void Discover_AssetPrefetcherHasConcreteTypeButNoVirtualMembers()

    Discover_Combo_IsNotUserDefined()

    Combo is a real, framework-defined Serenity aggregate — its assembly's simple name starts with "Serenity.", so it must never be flagged as user-defined.

    Declaration
    public void Discover_Combo_IsNotUserDefined()

    Discover_EligibleSubclassBases_ContainOnlyPublicNonAbstractNonTestImplementers()

    Every entry in every discovered aggregate's eligible-bases list must satisfy the whole eligibility rule: public, non-abstract class, from a non-Tests assembly, implementing the aggregate's interface, with overridable public or protected members. Sweeping the live catalog covers the exclusions (test-assembly fixtures like CollisionFixtures types, internal implementers like UnitySystemConfigurationSnapshotStore, abstract installers) without needing per-type fixtures.

    Declaration
    public void Discover_EligibleSubclassBases_ContainOnlyPublicNonAbstractNonTestImplementers()

    Discover_EligibleSubclassBases_EmptyForAggregateWithNoVirtualImplementer()

    AssetPrefetcher's only public implementer has no virtual members, so NOTHING is subclassable for it — the list must be empty, which is exactly what blocks the Subclass style (see ServiceExtensionCreatorValidationTests.Validate_RejectsInfrastructureForAggregateWithoutVirtualMembers).

    Declaration
    public void Discover_EligibleSubclassBases_EmptyForAggregateWithNoVirtualImplementer()

    Discover_EligibleSubclassBases_PutsCanonicalFirst()

    The canonical Unity{X}Service must always be the FIRST eligible subclass base when it qualifies — the empty-name default in Input.SubclassBaseTypeName picks index 0, so this ordering IS the V1 back-compat guarantee.

    Declaration
    public void Discover_EligibleSubclassBases_PutsCanonicalFirst()

    Discover_EveryDescriptorHasNameAndInterfaceType()

    Declaration
    public void Discover_EveryDescriptorHasNameAndInterfaceType()

    Discover_ExcludesGlobalAndServiceLocator()

    Declaration
    public void Discover_ExcludesGlobalAndServiceLocator()

    Discover_FrameworkSubServiceWithNoModuleFolder_StaysAbsent(string)

    ICompositeViewService ("CompositeView", under Ui) and ICascadeViewService ("CascadeView", under Menu) live in framework (Serenity.*) assemblies with no matching Assets/Serenity/Scripts/Business/{X} module folder — the folder gate must still apply to them. A genuine user-assembly aggregate bypassing the folder gate cannot be simulated from this Tests assembly (a real separate, non-"Serenity."-prefixed assembly would be needed) — that positive case is covered by the orchestrator's live smoke test instead, not a unit test here.

    Declaration
    public void Discover_FrameworkSubServiceWithNoModuleFolder_StaysAbsent(string subServiceName)
    Parameters
    Type Name Description
    string subServiceName

    Discover_GameCamera_ConcreteTypeIsNotAComponent()

    UnityGameCameraService is a plain class (no MonoBehaviour) — the Service Extension Creator's InfrastructureSubclass generation must special-case it (see Create_InfrastructureSubclassForPlainClassBase_GeneratesForwardingConstructorAndCreateServiceFactory()), but discovery itself treats it like any other concrete service.

    Declaration
    public void Discover_GameCamera_ConcreteTypeIsNotAComponent()

    Discover_IncludesComboAsGameplayVirtualizedAggregate()

    Declaration
    public void Discover_IncludesComboAsGameplayVirtualizedAggregate()

    Discover_IncludesScore()

    Declaration
    public void Discover_IncludesScore()

    Discover_NewlyConformingCoreAggregate_IsCoreInstalledWithVirtualizedConcreteType(string)

    Feedback, GameCamera, SystemConfiguration and ViewBrowser only became eligible once their I{X}Service interfaces were made to extend IService (a prior phase). All four have a concrete Unity{X}Service that was touched by the Phase 0 virtualization sweep, so the Infrastructure base must be fully available for every one of them.

    Declaration
    public void Discover_NewlyConformingCoreAggregate_IsCoreInstalledWithVirtualizedConcreteType(string aggregateName)
    Parameters
    Type Name Description
    string aggregateName

    Discover_Persistence_EligibleSubclassBasesContainThePublicBusinessService()

    Persistence has no canonical UnityPersistenceService, but the public business PersistenceService implements IPersistenceService with public virtual operations — it must surface as an eligible subclass base, making the Subclass style available for Persistence for the first time.

    Declaration
    public void Discover_Persistence_EligibleSubclassBasesContainThePublicBusinessService()

    Discover_Persistence_IsCoreInstalledWithNoConcreteUnityService()

    Persistence became core-installed once UnitySerenityInstaller.InstallPersistence was added, but there is no UnityPersistenceService — the business PersistenceService implements IPersistenceService directly, so the CANONICAL concrete lookup stays null. The Subclass style is still available through the eligible-bases list (PersistenceService itself qualifies — see Discover_Persistence_EligibleSubclassBasesContainThePublicBusinessService()).

    Declaration
    public void Discover_Persistence_IsCoreInstalledWithNoConcreteUnityService()

    Discover_ReturnsNonEmptyCatalog()

    Declaration
    public void Discover_ReturnsNonEmptyCatalog()

    Discover_TestAssemblyServiceInterface_IsExcluded()

    ExtensionPointCatalogCollisionFixtures.IScratchFixtureService (this test assembly) derives IService and matches the I{X}Service pattern — proves the test-assembly exclusion added alongside user-aggregate discovery: without it, this fixture would wrongly surface as a discoverable "ScratchFixture" aggregate.

    Declaration
    public void Discover_TestAssemblyServiceInterface_IsExcluded()

    Invalidate_ForcesNextDiscoverToRescan()

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