Class ProjectWiringRunnerTests
EditMode tests for Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectWiringRunner against a disposable scratch output root — the
shipped project tree is never written to. Mirrors SerenityCreateGameSceneGeneratorTests's
cleanup pattern: every asset a run's OWN generated content lands under Serenity.CreateGame.Tests.Editor.ProjectWiringRunnerTests.ScratchFolder, so
TearDown() strips that one subtree's Addressables entries before deleting it — including the
project's own initialization pipeline profile, which Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectPipelineProfileFactory always
creates under its own pinned Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectPipelineProfileFactory.ProjectProfileFolder regardless
of Serenity.CreateGame.Tests.Editor.ProjectWiringRunnerTests.OutputRoot, redirected here to a subfolder of Serenity.CreateGame.Tests.Editor.ProjectWiringRunnerTests.ScratchFolder via
Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectPipelineProfileFactory.SetProjectProfileFolderOverrideForTests(System.String,System.String). Creating a profile
now adopts the shipped canonical one, cloning into Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectPipelineAdoption.AdoptionOutputRoot
first — also redirected here, to Serenity.CreateGame.Tests.Editor.ProjectWiringRunnerTests.ScratchFolder itself, via
Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectPipelineAdoption.SetAdoptionOutputRootOverrideForTests(System.String) — so the real project's own
pipeline folder and Assets/Game content are never touched.
Inherited Members
Namespace: Serenity.CreateGame.Tests.Editor
Assembly: Serenity.CreateGame.Tests.Editor.dll
Syntax
public class ProjectWiringRunnerTests
Constructors
ProjectWiringRunnerTests()
Declaration
public ProjectWiringRunnerTests()
Methods
OneTimeTearDown()
Declaration
public static void OneTimeTearDown()
ResolveRequiredSceneSettings_ModalDeselected_NeverMentionsModalEvenThoughOnlyItsShippedAssetExists()
Modal deselected while Ui/GameMode/Menu stay selected: Modal's settings must never appear in the missing list — its Settings-step row does not exist for a deselected system, so a message naming it would point Create's confirmation at nothing.
Declaration
public void ResolveRequiredSceneSettings_ModalDeselected_NeverMentionsModalEvenThoughOnlyItsShippedAssetExists()
ResolveRequiredSceneSettings_NoneOfTheFourSelected_IsFullyResolvableWithNothingMissing()
The settings requirement follows selection: with NONE of Ui/GameMode/Menu/Modal selected, Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectWiringRunner.ResolveRequiredSceneSettings(System.Collections.Generic.IReadOnlyList{Serenity.CreateGame.Infrastructure.Editor.Systems.SerenityInstallableSystem}) must ask for none of their settings, since SerenityCreateGameSceneGenerator never wires an unselected system's field anyway (it writes it explicitly empty).
Declaration
public void ResolveRequiredSceneSettings_NoneOfTheFourSelected_IsFullyResolvableWithNothingMissing()
Run_AmbiguousPlan_ReturnsFailureWithoutCreatingAnything()
Declaration
public void Run_AmbiguousPlan_ReturnsFailureWithoutCreatingAnything()
Run_CreateStateNoSelectedSystemsScenesOff_CreatesTheProfileAndSucceeds()
Declaration
public void Run_CreateStateNoSelectedSystemsScenesOff_CreatesTheProfileAndSucceeds()
Run_CreateStateTwoSystemsOutOfCanonicalOrder_ProfileTaskOrderMatchesPlanOrder()
Selects "InstallLeaderboard" then "InstallScore" — the reverse of their canonical order — so a Create run's seeded profile can be checked against the plan it was seeded from: both must list the two tasks in the same (canonical) order, or the Summary step showed the reader something Create did not actually do.
Declaration
public void Run_CreateStateTwoSystemsOutOfCanonicalOrder_ProfileTaskOrderMatchesPlanOrder()
Run_FailingAfterProfileCreation_LeavesNoProfileBehind()
Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectWiringRunner.Run(Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectWiringPlan,Serenity.ProjectRecipe.Infrastructure.Editor.SetupAssistant.MinimalLoopOptions,Serenity.CreateGame.Infrastructure.Editor.CreateGameScenesOptions,System.Collections.Generic.IReadOnlyList{Serenity.CreateGame.Infrastructure.Editor.Systems.SerenityInstallableSystem},Serenity.Global.Infrastructure.Editor.SerenityWizardActivityLog) resolves-or-creates the profile first, then ensures the
foundation logging settings — a failure seam reachable by giving the console log settings asset an
empty Id, which GenericAssetRecipeImporter reports as an Error (not a Blocker, so the import
phase still runs, but TryEnsureFoundationLoggingSettings still reports failure via
report.HasErrors). The profile the run created moments earlier must not survive that failure —
otherwise a retry would read it as an already-owned profile (Reuse)
instead of trying Create again.
Declaration
public void Run_FailingAfterProfileCreation_LeavesNoProfileBehind()
Run_ProfileCreatedThisRunThenSceneGenerationFailsForMissingSettings_RollsBackTheProfile()
Proves the all-or-nothing rollback contract at the runner level, independently of the Summary/Create gate: even a plan that itself reports no blocking error (built while scene generation was off) must not let Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectWiringRunner.Run(Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectWiringPlan,Serenity.ProjectRecipe.Infrastructure.Editor.SetupAssistant.MinimalLoopOptions,Serenity.CreateGame.Infrastructure.Editor.CreateGameScenesOptions,System.Collections.Generic.IReadOnlyList{Serenity.CreateGame.Infrastructure.Editor.Systems.SerenityInstallableSystem},Serenity.Global.Infrastructure.Editor.SerenityWizardActivityLog) leave a freshly created profile behind once scene generation turns out to need settings the project does not resolve. ProjectWiringRunner.TryResolveGeneratedAssets reads the project's LIVE state, never the plan's own cached answer, so a stale or mismatched plan can never fool the run into reporting success on a half-wired project.
Declaration
public void Run_ProfileCreatedThisRunThenSceneGenerationFailsForMissingSettings_RollsBackTheProfile()
Run_ReuseStateNewSystemReferencesItsShippedTask_CreatedAssetPathsStaysEmpty()
Every catalog system ships its own default task asset under Media/Global/Tasks/, so wiring
one for the first time resolves to Insert (reference
the existing — here, shipped — asset), never CreateAndInsert.
Referencing an already-existing asset must never be reported as something THIS run created — the
profile itself is what changed (TasksInsertedCount), not a new
asset. The Create-path counterpart (a freshly adopted profile's own cloned boot tasks) is covered by
Run_CreateStateNoSelectedSystemsScenesOff_CreatesTheProfileAndSucceeds() and
ProjectPipelineProfileFactoryTests.TryCreateFromShipped_CutscenePlayerSelected_CreatedPathsNamesEveryClonedAsset.
Declaration
public void Run_ReuseStateNewSystemReferencesItsShippedTask_CreatedAssetPathsStaysEmpty()
Run_ReusedProfileWithForcedSceneGenerationFailure_LeavesTheProfileByteIdenticalAndReportsFailure()
Boot-task wiring runs only once scene generation has already succeeded, so a REUSED (project-owned, not this-run-created) profile is never mutated by a run whose scene generation then fails. Selects a system that needs none of the four settings, so the plan itself never blocks and the forced failure is what actually stops the run.
Declaration
public void Run_ReusedProfileWithForcedSceneGenerationFailure_LeavesTheProfileByteIdenticalAndReportsFailure()
Run_ScenesRequestedWithNoResolvableSettingsAnywhereInTheProject_PlanBlocksAndRunFails()
A Summary/Confirm that promises scene generation must never be paired with a Create run that silently drops it while still reporting overall success. With no project-owned Ui/GameMode/Menu/Modal settings anywhere in this repo, scene generation can never resolve what it needs — the plan itself must refuse to promise it (HasBlockingError), and a run that somehow still reaches Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectWiringRunner.Run(Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectWiringPlan,Serenity.ProjectRecipe.Infrastructure.Editor.SetupAssistant.MinimalLoopOptions,Serenity.CreateGame.Infrastructure.Editor.CreateGameScenesOptions,System.Collections.Generic.IReadOnlyList{Serenity.CreateGame.Infrastructure.Editor.Systems.SerenityInstallableSystem},Serenity.Global.Infrastructure.Editor.SerenityWizardActivityLog) with such a plan must fail outright rather than wire the profile/tasks and call the run a success.
Declaration
public void Run_ScenesRequestedWithNoResolvableSettingsAnywhereInTheProject_PlanBlocksAndRunFails()
Run_TwoProjectOwnedProfilesWithAPick_WiresOnlyThePickedProfileAndLeavesTheOtherByteIdentical()
Several profiles is a choice, not a dead end: once the reader picks one off an Ambiguous "Boot pipeline" row, Create wires EXACTLY that profile — the other candidate is never touched, byte for byte, proving the pick genuinely narrows which asset this run may write into rather than merely picking which one the Summary happens to describe.
Declaration
public void Run_TwoProjectOwnedProfilesWithAPick_WiresOnlyThePickedProfileAndLeavesTheOtherByteIdentical()
Run_UiSettingsHasProjectOwnedCloneAlongsideShipped_ScenGenerationResolvesToTheProjectOwnedClone()
Reproduces the owner's reported defect: a shipped 'UnityUiSettings' asset ships at
'Assets/Serenity/Media/Ui/UiSettings.asset', and this adds a second, project-owned clone under the
scratch folder — the exact shape ResolveSettingsContext(string, string, string) reports
as MultipleFoundPaths, which ProjectWiringRunner.ResolveExistingSettingsPath used
to treat as missing outright even though the project's own clone was right there. GameMode/Menu/Modal
settings have no project-owned clone in this repo — only their shipped copy — so scene generation
still fails for those three (now with the "only the shipped asset" wording), proving the same rule
applies uniformly; UnityUiSettings alone must never appear in that failure, since its project-owned
clone is the one that gets picked.
Declaration
public void Run_UiSettingsHasProjectOwnedCloneAlongsideShipped_ScenGenerationResolvesToTheProjectOwnedClone()
SetUp()
Declaration
public void SetUp()
TearDown()
Declaration
public void TearDown()