logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class MenuCreatorTests

    EditMode tests for MenuCreator: drafts creating new menu assets, drafts loaded from an existing asset updating it in place, and id-collision validation across a batch of drafts and the project's existing menus. Mirrors MenuServiceSettingsCreatorTests's temp-folder pattern.

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

    Constructors

    MenuCreatorTests()

    Declaration
    public MenuCreatorTests()

    Methods

    CreateNew_AssignsTheDraftItsOwnGuid()

    Declaration
    public void CreateNew_AssignsTheDraftItsOwnGuid()

    Create_DraftTargetingASiblingDraft_WritesTheSiblingsGuidAndId()

    Declaration
    public void Create_DraftTargetingASiblingDraft_WritesTheSiblingsGuidAndId()

    Create_ExistingDraftTargetingANewDraft_WritesTheNewDraftsId()

    Declaration
    public void Create_ExistingDraftTargetingANewDraft_WritesTheNewDraftsId()

    Create_InvalidOutputFolder_RollsBackLeavingNoMenuAssets()

    Forces a genuine failure the same way MenuServiceSettingsCreatorTests.Create_FailureRollsBack does: a folder Unity's AssetDatabase cache still reports as valid, but that has actually been removed from disk directly.

    Declaration
    public void Create_InvalidOutputFolder_RollsBackLeavingNoMenuAssets()

    Create_LoadedExistingDraft_UpdatesSameGuidAndCreatesNoNewFile()

    Declaration
    public void Create_LoadedExistingDraft_UpdatesSameGuidAndCreatesNoNewFile()

    Create_NewDraft_PreservesTheDraftsGuidOnTheWrittenAsset()

    Declaration
    public void Create_NewDraft_PreservesTheDraftsGuidOnTheWrittenAsset()

    Create_RefreshesTheTransitionTargetCatalogWithoutAManualRefresh()

    Regression test for the catalog-staleness bug this class fixes: Create(Input) itself refreshes MenuTransitionTargetCatalog on its success path, so a caller that checks the catalog right after Create() — with no manual Refresh() of its own, unlike every other test in this file — still sees the menu it just wrote.

    Declaration
    public void Create_RefreshesTheTransitionTargetCatalogWithoutAManualRefresh()

    Create_SiblingTargetRenamedAfterItWasPicked_WritesTheNewId()

    Declaration
    public void Create_SiblingTargetRenamedAfterItWasPicked_WritesTheNewId()

    Create_TwiceWithoutExplicitExistingPath_UpdatesTheServiceSettingsSingletonInsteadOfFailing()

    Regression test for the get-or-create bug this class fixes: a second Create(Input) call that never sets MenuServiceSettingsCreator.Input.ExistingSettingsAssetPath must resolve the singleton the first call already created (scoped to the shared ServiceSettingsFolder) and update it in place, instead of failing with "an asset already exists".

    Declaration
    public void Create_TwiceWithoutExplicitExistingPath_UpdatesTheServiceSettingsSingletonInsteadOfFailing()

    Create_TwoNewDrafts_CreatesTwoAssetsWithTheirIds()

    Declaration
    public void Create_TwoNewDrafts_CreatesTwoAssetsWithTheirIds()

    OneTimeTearDown()

    Declaration
    public void OneTimeTearDown()

    SetUp()

    Declaration
    public void SetUp()

    TearDown()

    Declaration
    public void TearDown()

    Validate_ALabelTranslatedButNotInAnyStringTable_WarnsWithoutBlocking()

    Declaration
    public void Validate_ALabelTranslatedButNotInAnyStringTable_WarnsWithoutBlocking()

    Validate_AcceptsEveryTargetTheAssetInspectorAccepts()

    The wizard's known set is a superset of the one the asset inspector validates against (KnownTargetIds()), never the narrower list the Value dropdown offers: a composite view nested inside another is a legal authored target the dropdown deliberately omits, so validating against the dropdown would report a shipped menu loaded with "Add existing" as an Error and block the whole run.

    Declaration
    public void Validate_AcceptsEveryTargetTheAssetInspectorAccepts()

    Validate_DuplicateDraftIds_ReportsError()

    Declaration
    public void Validate_DuplicateDraftIds_ReportsError()

    Validate_IdAlreadyUsedByExistingAsset_ReportsError()

    Declaration
    public void Validate_IdAlreadyUsedByExistingAsset_ReportsError()

    Validate_LoadedDraftsOwnId_IsNotACollision()

    Declaration
    public void Validate_LoadedDraftsOwnId_IsNotACollision()

    Validate_TransitionToASiblingDraft_IsValid()

    Declaration
    public void Validate_TransitionToASiblingDraft_IsValid()

    Validate_TransitionToATargetNothingProvides_ReportsError()

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