Class ProjectPipelineProfileFactoryTests
EditMode tests for Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectPipelineProfileFactory. Creating a profile now adopts the shipped canonical one (Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectPipelineAdoption), which clones into Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectPipelineAdoption.AdoptionOutputRoot before the adopted profile itself is moved to Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectPipelineProfileFactory.ProjectProfileFolder — so every test here redirects BOTH seams to the same disposable scratch root via Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectPipelineProfileFactory.SetProjectProfileFolderOverrideForTests(System.String,System.String) and Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectPipelineAdoption.SetAdoptionOutputRootOverrideForTests(System.String) before running and restores them in TearDown() — the real project's own DefaultOutputFolder and Serenity.Global.Infrastructure.Editor.SerenityUserContentPaths.GameRoot are never touched.
Inherited Members
Namespace: Serenity.CreateGame.Tests.Editor
Assembly: Serenity.CreateGame.Tests.Editor.dll
Syntax
public class ProjectPipelineProfileFactoryTests
Constructors
ProjectPipelineProfileFactoryTests()
Declaration
public ProjectPipelineProfileFactoryTests()
Methods
OneTimeTearDown()
Declaration
public void OneTimeTearDown()
ProjectProfileFolder_WithoutOverride_IsTheCreatorsDefaultFolder()
Declaration
public void ProjectProfileFolder_WithoutOverride_IsTheCreatorsDefaultFolder()
ProjectProfileFolder_WithoutOverride_MatchesTheWizardNoticesDuplicatedDefault()
Serenity.Global.Infrastructure.Editor.InitializationPipeline.NoProjectProfileNoticeGui.DefaultProjectPipelineOutputFolder duplicates this factory's default on purpose (the Global editor assembly cannot reference the CreateGame editor assembly this factory lives in) — this test is the guard against the two drifting apart.
Declaration
public void ProjectProfileFolder_WithoutOverride_MatchesTheWizardNoticesDuplicatedDefault()
SetProjectProfileFolderOverrideForTests_RedirectsCreation()
Declaration
public void SetProjectProfileFolderOverrideForTests_RedirectsCreation()
SetUp()
Declaration
public void SetUp()
TearDown()
Declaration
public void TearDown()
TryCreateFromShipped_AdoptedProfile_IsNamedAfterProfileIdAndCarriesItsId()
Declaration
public void TryCreateFromShipped_AdoptedProfile_IsNamedAfterProfileIdAndCarriesItsId()
TryCreateFromShipped_BlankProfileId_FailsWithAnErrorAndCreatesNothing()
Declaration
public void TryCreateFromShipped_BlankProfileId_FailsWithAnErrorAndCreatesNothing()
TryCreateFromShipped_CalledTwice_SecondCallReusesWithoutCreatingASecondAsset()
Declaration
public void TryCreateFromShipped_CalledTwice_SecondCallReusesWithoutCreatingASecondAsset()
TryCreateFromShipped_CutscenePlayerNotSelected_ClonesNoSplashTaskOrCutsceneAssets()
With the Cutscene Player deselected, the seeded profile's own Tasks list correctly excludes the
three Play*SplashScreen tasks (Serenity.CreateGame.Infrastructure.Editor.BootTaskRequirements) — and nothing else in the
project ends up with a clone of one either. The adoption closure's roots always include the whole
shipped canonical profile asset (ProjectPipelineAdoption.BuildRoots), and that profile's own
serialized Tasks[] references every splash task regardless of selection, so
UnityEditor.AssetDatabase.GetDependencies(System.String,System.Boolean) would otherwise walk into them as ordinary
object-reference dependencies of the root, independently of the caller's filtered
shippedTaskPaths list — ProjectPipelineAdoption.IsUnselectedShippedTask excludes
exactly that from the closure.
Declaration
public void TryCreateFromShipped_CutscenePlayerNotSelected_ClonesNoSplashTaskOrCutsceneAssets()
TryCreateFromShipped_CutscenePlayerSelected_AdoptsTheSplashTasksAndRePointsTheirCutsceneArguments()
The seed profile is the FULL shipped one, so a project that selected the Cutscene Player gets the Serenity splash — as ITS OWN content: the three splash tasks land under the adoption output root, and each one's opaque Guid argument points at the cutscene clone beside them, never at the package's own splash cutscene.
Declaration
public void TryCreateFromShipped_CutscenePlayerSelected_AdoptsTheSplashTasksAndRePointsTheirCutsceneArguments()
TryCreateFromShipped_CutscenePlayerSelected_CreatedPathsNamesEveryClonedAsset()
The full created-paths list must name every asset this adoption cloned — the profile itself plus every boot task and cutscene package content it reached through an opaque Guid argument — not just the profile's own path, so a caller aggregating a Done step's "Created" list never undercounts.
Declaration
public void TryCreateFromShipped_CutscenePlayerSelected_CreatedPathsNamesEveryClonedAsset()
TryCreateFromShipped_NeverLeavesAnEmptyMirroredProfilesFolderBehind()
The adoption closure mirrors Serenity.CreateGame.Infrastructure.Editor.SerenityBootTaskCatalog.ShippedProfilePath — under the
shipped package, a "Profiles" folder — into the adoption output root, then
ProjectPipelineAdoption.NormalizeAdoptedProfileToProjectIdentity immediately moves the one
profile asset that folder ever holds out to Serenity.CreateGame.Infrastructure.Editor.Wiring.ProjectPipelineProfileFactory.ProjectProfileFolder.
The mirrored "Profiles" folder itself is pruned once empty — it is never populated again and never
expected by anything else in the project.
Declaration
public void TryCreateFromShipped_NeverLeavesAnEmptyMirroredProfilesFolderBehind()
TryCreateFromShipped_NoSelection_CreatesAProfileWithInfrastructureTasksOnly()
Declaration
public void TryCreateFromShipped_NoSelection_CreatesAProfileWithInfrastructureTasksOnly()
TryCreateFromShipped_RegistersTheProfileAsAddressable()
Declaration
public void TryCreateFromShipped_RegistersTheProfileAsAddressable()
TryCreateFromShipped_SelectedSystemWithoutAShippedTask_ReportsTheTaskItCreated()
A selected system the shipped profile carries no task for gets one created on the way — and that write belongs to this call's outcome, which Adopt All and Create both hand to the Done step.
Declaration
public void TryCreateFromShipped_SelectedSystemWithoutAShippedTask_ReportsTheTaskItCreated()
TryCreateFromShipped_TaskList_LivesUnderTheAdoptionOutputRootsMediaGlobalTasksFolder()
Declaration
public void TryCreateFromShipped_TaskList_LivesUnderTheAdoptionOutputRootsMediaGlobalTasksFolder()
TryCreateFromShipped_TwoSystemsOutOfCanonicalOrder_ProfileTaskOrderIsCanonical()
Declaration
public void TryCreateFromShipped_TwoSystemsOutOfCanonicalOrder_ProfileTaskOrderIsCanonical()