Class HudCreatorDuplicateIdTests
A create run (no ExistingAsset) whose Id already belongs to another
UnityHudDefinition anywhere in the project must be refused, not silently succeed with a
second HUD sharing the first one's Id — two Addressable HUDs sharing an Id make ShowHudSignal's
target genuinely ambiguous at runtime. Every test targets a private temp folder, so the project's own
HUDs and Addressables settings are never touched.
Inherited Members
Namespace: Serenity.GameUi.Tests.Editor.Builder
Assembly: Serenity.GameUi.Tests.Editor.dll
Syntax
public class HudCreatorDuplicateIdTests
Constructors
HudCreatorDuplicateIdTests()
Declaration
public HudCreatorDuplicateIdTests()
Methods
Create_DuplicateIdWithNoExistingAsset_IsRefusedAndCreatesNoSecondHud()
Declaration
public void Create_DuplicateIdWithNoExistingAsset_IsRefusedAndCreatesNoSecondHud()
OneTimeTearDown()
Declaration
public void OneTimeTearDown()
SetUp()
Declaration
public void SetUp()
TearDown()
Declaration
public void TearDown()
Validate_CaseVariantIdWithNoExistingAsset_ReportsAnError()
A same-type asset carrying an Id that differs only by letter case is exactly the kind of near-miss HudCreator's runtime resolution would treat as a genuine collision risk — the check must catch it, not just an ordinal exact match.
Declaration
public void Validate_CaseVariantIdWithNoExistingAsset_ReportsAnError()
Validate_DuplicateIdWithNoExistingAsset_ReportsAnError()
Declaration
public void Validate_DuplicateIdWithNoExistingAsset_ReportsAnError()
Validate_FreeId_ReportsNoDuplicateError()
Declaration
public void Validate_FreeId_ReportsNoDuplicateError()
Validate_UpdatingExistingAssetKeepingAPreExistingDuplicateId_ReportsAWarningNotAnError()
Two HUDs already share a pre-existing Id, predating this run (simulated here by assigning Id directly, bypassing Validate(Input) the way an import or a hand-edited asset would). Updating one of them WITHOUT changing its Id must stay possible — the duplicate is not something this run is creating — so it is reported as a warning, not a blocking error, leaving Serenity.Global.Infrastructure.Editor.SerenityCreationValidationResult.IsValid true.
Declaration
public void Validate_UpdatingExistingAssetKeepingAPreExistingDuplicateId_ReportsAWarningNotAnError()
Validate_UpdatingExistingAssetRenamedToAGenuinelyFreeId_ReportsNoDuplicateError()
Companion regression guard: renaming to a genuinely free Id during an update must still succeed — the fix must not turn every update into a false-positive collision with itself.
Declaration
public void Validate_UpdatingExistingAssetRenamedToAGenuinelyFreeId_ReportsNoDuplicateError()
Validate_UpdatingExistingAssetWithAnIdThatCollidesWithAnotherHud_ReportsAnError()
Renaming an existing HUD's Id to one that ALREADY belongs to a DIFFERENT existing HUD is refused: the check runs regardless of whether ExistingAsset is set, excluding only the asset actually being updated, so two HUDs never end up sharing an Id.
Declaration
public void Validate_UpdatingExistingAssetWithAnIdThatCollidesWithAnotherHud_ReportsAnError()
Validate_UpdatingTheExistingAssetWithItsOwnId_ReportsNoDuplicateError()
Declaration
public void Validate_UpdatingTheExistingAssetWithItsOwnId_ReportsNoDuplicateError()