Class ExtensionPointCatalogTests
EditMode tests for Discover(): the reflection-based discovery of
every extension point kind beyond the I{X}Service aggregates AggregateCatalog
already covers. Asserts against the live project catalog, since discovery is inherently a scan over
loaded assemblies.
Inherited Members
Namespace: Serenity.ServiceExtensionCreator.Tests.Editor
Assembly: Serenity.ServiceExtensionCreator.Tests.Editor.dll
Syntax
public class ExtensionPointCatalogTests
Constructors
ExtensionPointCatalogTests()
Declaration
public ExtensionPointCatalogTests()
Methods
DiscoverNotSubclassableUserClasses_EveryEntrySatisfiesItsBucketAndIsInNeitherDescriptorTier()
Every not-subclassable entry must be a public user class in exactly one of the three explained buckets — sealed, abstract, or method-less (a public open class with nothing to override AND nothing to virtualize; without this bucket a POCO/DTO would silently match no tier at all) — with the reason matching its bucket, never a static class (sealed AND abstract), never a delegate, and never also in a selectable tier.
Declaration
public void DiscoverNotSubclassableUserClasses_EveryEntrySatisfiesItsBucketAndIsInNeitherDescriptorTier()
DiscoverUserClasses_EveryDescriptorSatisfiesTheEligibilityRuleAndShape()
Sweeps every discovered user class against the whole eligibility rule — public, non-abstract, non-sealed, non-generic-definition, overridable members, non-excluded assembly — plus the fixed Class-kind descriptor shape. The sweep covers the exclusions (Serenity/Unity/BCL/test assemblies, abstract/sealed classes) without needing per-type fixtures, which this Tests assembly could not provide anyway (its own types are excluded by the "Tests" assembly rule — pinned below).
Declaration
public void DiscoverUserClasses_EveryDescriptorSatisfiesTheEligibilityRuleAndShape()
DiscoverUserClasses_ExcludesTestAssemblyClasses()
CollisionFixtures.CustomComboBase is public and non-sealed, but it lives in this
Tests assembly — the assembly exclusion must keep it (and every other fixture) out.
Declaration
public void DiscoverUserClasses_ExcludesTestAssemblyClasses()
DiscoverVirtualizableUserClasses_AreDisjointFromEligibleAndSatisfyTheRule()
The eligible and needs-virtualization tiers are disjoint by construction (a class either has overridable methods — public or protected — or it does not), and every needs-virtualization descriptor must satisfy its whole rule: flagged, truthfully not-yet-subclassable, with at least one patchable public instance method to offer in the member checklist.
Declaration
public void DiscoverVirtualizableUserClasses_AreDisjointFromEligibleAndSatisfyTheRule()
Discover_AudioPlayerGateway_HasAnInstallerHookWiringCapability()
Declaration
public void Discover_AudioPlayerGateway_HasAnInstallerHookWiringCapability()
Discover_ContainsNoClassKindDescriptors()
The user-class scan is deliberately its own lazy cache — the main catalog must never pay for sweeping every user type in the project (the wizard only queries user classes while searching).
Declaration
public void Discover_ContainsNoClassKindDescriptors()
Discover_EligibleSubclassBases_ExcludeTheInternalSnapshotStore()
Extension-point descriptors carry the same eligible-subclass-bases rule as aggregates: only public,
non-abstract, non-test implementers with overridable members qualify. The internal
UnitySystemConfigurationSnapshotStore must never appear (it fails the public gate), while the
public UnitySystemConfigurationService — which also implements the contract — may.
Declaration
public void Discover_EligibleSubclassBases_ExcludeTheInternalSnapshotStore()
Discover_EveryDescriptorHasCompleteIdentity()
Declaration
public void Discover_EveryDescriptorHasCompleteIdentity()
Discover_EveryStoreRepositoryGatewayFactoryDescriptor_ToleratesNullConcreteType()
A contract interface with no public implementer at all (not merely a non-public one) is still a
valid, generatable extension point — a first-implementation scenario. ConcreteType is null
rather than the descriptor being skipped entirely (see Discover_ServiceKind_DelegatesToAggregateCatalog()
for the invariant this complements: every eligible contract surfaces, implemented or not).
Declaration
public void Discover_EveryStoreRepositoryGatewayFactoryDescriptor_ToleratesNullConcreteType()
Discover_ExcludesNonCuratedFactoryInterfaces()
Declaration
public void Discover_ExcludesNonCuratedFactoryInterfaces()
Discover_IncludesBothGatewayExtensionPoints(string)
Declaration
public void Discover_IncludesBothGatewayExtensionPoints(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Discover_IncludesCuratedFactoryExtensionPoints(string)
Declaration
public void Discover_IncludesCuratedFactoryExtensionPoints(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Discover_IncludesExpectedStoreExtensionPoints(string)
Declaration
public void Discover_IncludesExpectedStoreExtensionPoints(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Discover_IncludesPersistenceInstaller()
Declaration
public void Discover_IncludesPersistenceInstaller()
Discover_IncludesScoreRepository()
Declaration
public void Discover_IncludesScoreRepository()
Discover_InstallerKind_HasNoEligibleSubclassBases()
The Installer kind subclasses the abstract PersistenceInstaller through its own
dedicated path — its eligible-bases list stays empty by design (no base picker is ever offered).
Declaration
public void Discover_InstallerKind_HasNoEligibleSubclassBases()
Discover_InstallerKind_IgnoresTestAssemblyNameCollision()
ExtensionPointCatalogCollisionFixtures.PersistenceInstaller (this test assembly) collides by
simple name with the real abstract backend base. DiscoverInstallers must exclude test assemblies,
so the Installer extension point still resolves exactly once, to the real type — without that filter
the collision would make discovery ambiguous and skip the Installer kind entirely.
Declaration
public void Discover_InstallerKind_IgnoresTestAssemblyNameCollision()
Discover_MusicPlayerGateway_HasNoInstallerHookYet()
Declaration
public void Discover_MusicPlayerGateway_HasNoInstallerHookYet()
Discover_NeverSurfacesAnInternalConcreteTypeAsAnImplementer()
Declaration
public void Discover_NeverSurfacesAnInternalConcreteTypeAsAnImplementer()
Discover_ReturnsNonEmptyCatalog()
Declaration
public void Discover_ReturnsNonEmptyCatalog()
Discover_ScoreRepositoryInstallerHook_IgnoresTestAssemblyNameCollision()
ExtensionPointCatalogCollisionFixtures.UnityScoreInstaller (this test assembly) collides by
simple name with the real installer. The hook lookup must exclude test assemblies, so the real
installer keeps winning — without that filter this collision would make the lookup ambiguous and
downgrade ScoreRepository to WiringCapability.None. Two colliding NON-test production types cannot
be simulated from here (the exclusion filter would hide any fixture we add), so that branch is
covered by the loud-skip logic itself plus ResolveInstallerHook's doc contract rather than a test.
Declaration
public void Discover_ScoreRepositoryInstallerHook_IgnoresTestAssemblyNameCollision()
Discover_ScoreRepository_HasAnInstallerHookWiringCapability()
Declaration
public void Discover_ScoreRepository_HasAnInstallerHookWiringCapability()
Discover_ServiceKind_DelegatesToAggregateCatalog()
Declaration
public void Discover_ServiceKind_DelegatesToAggregateCatalog()
Discover_StoreAndInstallerKinds_HaveBackendDefinitionWiring(ExtensionPointKind)
Declaration
public void Discover_StoreAndInstallerKinds_HaveBackendDefinitionWiring(ExtensionPointKind kind)
Parameters
| Type | Name | Description |
|---|---|---|
| ExtensionPointKind | kind |
Discover_StoreKind_ExcludesStructuralMarkerInterfaces(string)
Declaration
public void Discover_StoreKind_ExcludesStructuralMarkerInterfaces(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Discover_SystemConfigurationSnapshotStore_ResolvesThePublicServiceAsItsImplementer()
The dedicated UnitySystemConfigurationSnapshotStore is internal, BUT the public
UnitySystemConfigurationService ALSO implements ISystemConfigurationSnapshotStore —
so this contract is NOT a null-implementer extension point: FindPublicImplementer correctly
skips the internal store and resolves the public service instead. Pinned here because it is an easy
gotcha to trip over when reasoning about "contracts with only an internal implementer" — no
production contract currently has zero public implementers, so the genuine null-ConcreteType
discovery path is unit-covered via directly-constructed descriptors
(see AsmdefReferenceWriterTests) and end-to-end by the orchestrator's live smoke test.
Declaration
public void Discover_SystemConfigurationSnapshotStore_ResolvesThePublicServiceAsItsImplementer()
Discover_TestAssemblyContractInterface_IsExcluded()
ExtensionPointCatalogCollisionFixtures.IScratchFixtureStore (this test assembly) matches the
Store contract pattern — proves IsEligibleContractInterface's test-assembly exclusion: without
it, this fixture would wrongly surface as a "ScratchFixtureStore" Store-kind extension point.
Declaration
public void Discover_TestAssemblyContractInterface_IsExcluded()
InvalidateNotSubclassableUserClasses_ForcesNextDiscoverToRescan()
Declaration
public void InvalidateNotSubclassableUserClasses_ForcesNextDiscoverToRescan()
InvalidateUserClasses_ForcesNextDiscoverUserClassesToRescan()
Declaration
public void InvalidateUserClasses_ForcesNextDiscoverUserClassesToRescan()
InvalidateVirtualizableUserClasses_ForcesNextDiscoverToRescan()
Declaration
public void InvalidateVirtualizableUserClasses_ForcesNextDiscoverToRescan()
Invalidate_ForcesNextDiscoverToRescan()
Declaration
public void Invalidate_ForcesNextDiscoverToRescan()
UserClassTiers_AllExcludeTestAssemblyTypes()
The three fixture types below each fit one new tier's shape perfectly — living in this Tests assembly, NONE may surface in ANY user-class query (the assembly exclusion is tier-wide).
Declaration
public void UserClassTiers_AllExcludeTestAssemblyTypes()