Namespace Serenity.Menu.Tests.Editor
Classes
MainMenuGraphLoaderTests
EditMode tests for Serenity.Menu.Infrastructure.Editor.Builder.MainMenuGraphLoader.Load(Serenity.Menu.Application.Navigation.IMenuNavigationLookup,System.String): a chain of menus reachable from a temp
InitialViewId, an unset InitialViewId, and no settings asset at all.
searchRootFolder is always this fixture's temp folder, so the run never resolves the
package-shipped Assets/Serenity/Media/Ui/UiSettings.asset singleton instead of the fixture.
MenuCatalogNavigationLookupTests
EditMode tests for Serenity.Menu.Infrastructure.Editor.Builder.MenuCatalogNavigationLookup, the IMenuNavigationLookup
adapter Serenity.Menu.Infrastructure.Editor.Builder.MainMenuGraphLoader and the reachability walker use against the real project
catalog. Every composite fixture is created fresh in this fixture's own temp folder and
Addressables-registered under COMPOSITE_VIEW — now that
AddressablesManagedLabelNormalizer.ManagedLabels carries that label, a freshly registered
composite is genuinely visible to MenuTransitionTargetCatalog by the time the test
refreshes it, same as a freshly registered menu already was.
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.
MenuDraftTransitionTargetsTests
EditMode tests for Serenity.Menu.Infrastructure.Editor.Builder.MenuDraftTransitionTargets.Merge(System.Collections.Generic.IReadOnlyList{Serenity.Menu.Infrastructure.Settings.Editor.MenuTransitionTargetCandidate},System.Collections.Generic.IReadOnlyList{Serenity.Menu.Infrastructure.Editor.Builder.MenuDraft},Serenity.Menu.Infrastructure.Editor.Builder.MenuDraft), the rule deciding what a Menu Manager draft's TRANSITION option may target. Driven with a hand-built project list rather than MenuTransitionTargetCatalog, so the assertions describe the rule instead of whatever assets the test project happens to hold.
MenuPreviewLauncherThemeTests
EditMode tests for Serenity.Menu.Infrastructure.Editor.Builder.MenuPreviewLauncher.EffectivePreviewTheme: it must distinguish "no preview has ever been opened" (fall back to the seed) from "an open preview's author explicitly chose None (wireframe)" (stay null even though a seed exists) — a null-coalesce on CurrentThemeOfOpenWindow() alone cannot tell the two apart, since both return null. See Serenity.Menu.Infrastructure.Editor.Builder.MenuPreviewLauncher.EffectivePreviewTheme's own remarks.
MenuServiceSettingsCreatorTests
EditMode tests for MenuServiceSettingsCreator: field validation and, in a temporary
folder, actual settings asset creation — including the create-vs-update singleton contract. Every
fixture uses an explicit Serenity.Menu.Tests.Editor.MenuServiceSettingsCreatorTests.TempFolder and either an explicit new-asset path or an explicit
MenuServiceSettingsCreator.Input.ExistingSettingsAssetPath: Create(Input)
never scans the project for the singleton (only CreateMenuServiceSettingsWindow.PreselectExistingSingleton
does, via ResolveSettingsContext(string, string)), so these tests stay hermetic
even though the package ships its own real singleton at
Assets/Serenity/Media/Menu/MenuServiceSettings.asset — that asset is never touched here. Mirrors
Serenity.Audio.SoundMixerSettings.Tests.Editor.SoundMixerSettingsCreatorTests.
MenuServiceSettingsStepGuiConsumeReachableGraphLoadRequestTests
EditMode tests for ConsumeReachableGraphLoadRequest() — the gate OnBeforeDrawStep() checks before auto-loading the reachable menu graph.
MenuTransitionTargetCatalogProjectionTests
EditMode tests for MenusById(), NonMenuViewIds(), Serenity.Menu.Infrastructure.Settings.Editor.MenuTransitionTargetCatalog.ViewKindsById and Serenity.Menu.Infrastructure.Settings.Editor.MenuTransitionTargetCatalog.OutboundEdgesById: all ride the catalog's own session-cached, Addressables-label-based project scan (see MenuTransitionTargetCatalog's own remarks).
UiOptionLegacySubmitSignalShippedContentTests
An option authored before the submit-signal list existed shows its legacy signal with a "Move to list" button, and "+ Add On Submit Signal" moves it too before appending. On a menu the package ships both must refuse — the next package update overwrites that file — and the inspector must say why, while on the author's own copy both still move the signal.
The buttons are driven through Serenity.Menu.Infrastructure.Settings.Editor.UiOptionListInspectorGUI.PressMoveLegacySignalToListForTests(System.Int32) and Serenity.Menu.Infrastructure.Settings.Editor.UiOptionListInspectorGUI.PressAddSignalForTests(System.Int32), which run exactly what each button runs: a click cannot be synthesized on a row of a reorderable list drawn headlessly, because the row's rect is only known inside the list's own draw. The notice is proven through a real inspector draw.
UnityMenuSettingsDefinitionToStringTests
ToString() describes a menu in every authoring state, including one whose option list was never created — a diagnostic dump must never be the thing that throws.
UnityMenuViewInspectorSnapshotTests
The menu view's inspector reads runtime state that only exists once the menu is installed. In Edit mode no view model is bound, so reading it must answer "not bound" instead of throwing half-way through an IMGUI pass — an exception there leaves the inspector's layout groups open and the next component's header is drawn over leftover rows.
ViewNodeListGuiDuplicateTests
EditMode tests for Serenity.Menu.Infrastructure.Editor.Builder.ViewNodeListGui.DuplicateDraft(System.Collections.Generic.List{Serenity.Menu.Infrastructure.Editor.Builder.MenuDraft},System.Int32)'s identity handling: a duplicate is
built with EditorUtility.CopySerialized, which copies the source's guid too, so the copy must be
given one of its own — two drafts sharing a guid make a sibling transition target ambiguous and write
two assets that collide on the identity every by-guid lookup resolves through.