logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class InitializationPipelineProfileCreatorTests

    EditMode tests for InitializationPipelineProfileCreator. Every test targets fixture paths under a private temp folder — the real project's own initialization pipeline profiles, if any, are never touched — and every test passes an explicit DuplicateIdSearchFolder pinned to Serenity.InitializationPipeline.Tests.Editor.Builder.InitializationPipelineProfileCreatorTests.TempFolder so every project-wide scan is hermetic by construction. Mirrors the temp-folder SetUp/TearDown pattern of SequencePlayerCreatorTests and InstallTaskAuthoringTests.

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

    Constructors

    InitializationPipelineProfileCreatorTests()

    Declaration
    public InitializationPipelineProfileCreatorTests()

    Methods

    Create_ChangedProfileIdNotMatchingAnyExistingAssetInFolder_CreatesANewAssetInsteadOfEditing()

    Declaration
    public void Create_ChangedProfileIdNotMatchingAnyExistingAssetInFolder_CreatesANewAssetInsteadOfEditing()

    Create_ExistingDefinitionAlreadyInProfile_SkipsTheSecondInsertionWithAWarning()

    Declaration
    public void Create_ExistingDefinitionAlreadyInProfile_SkipsTheSecondInsertionWithAWarning()

    Create_ExistingDefinitionRow_InsertsTheAssetAsIsWithoutCreatingANewOne()

    Declaration
    public void Create_ExistingDefinitionRow_InsertsTheAssetAsIsWithoutCreatingANewOne()

    Create_ExistingProfileFileRemovedBeforeSecondRun_RestoresOriginalTasksAndRollsBackTheNewTaskAsset()

    Shape 2 — an EXISTING profile's update fails: its disk file is removed after the first successful Create(Input) call, forcing the second run's own post-mutation VerifyAssetWasWrittenToDisk check to fail AFTER the new task row has already been created and inserted in memory. ProfileSnapshot.RestoreOnto must undo both the Tasks-list mutation and, separately, the freshly created task asset must be deleted from disk — proving the restore path is actually exercised, not merely reachable.

    Declaration
    public void Create_ExistingProfileFileRemovedBeforeSecondRun_RestoresOriginalTasksAndRollsBackTheNewTaskAsset()

    Create_ExistingProfileFileRemovedWithAddressablesRegistered_RemovesTheNewlyRetaggedEntryOnRollback()

    Exercises RollBack's UnityAddressablesLabeler.RemoveEntries(retaggedPaths) branch with a genuinely non-empty list — every OTHER rollback test in this suite runs with RegisterAsAddressables false (via Serenity.InitializationPipeline.Tests.Editor.Builder.InitializationPipelineProfileCreatorTests.BuildInput(System.String,System.String)'s default), so that branch was previously dead code from the suite's perspective even though the window always passes true. Forces the SAME existing-profile failure as the rollback shape-2 test below, but with Addressables registration on: the second run's new task asset gets created AND retagged before the profile's own post-mutation disk check fails, so rollback must remove that transient entry, not just delete the file.

    Declaration
    public void Create_ExistingProfileFileRemovedWithAddressablesRegistered_RemovesTheNewlyRetaggedEntryOnRollback()

    Create_InsertAtEnd_PreservesPreExistingTasksAndAppendsNewOnesInAuthoredOrder()

    Declaration
    public void Create_InsertAtEnd_PreservesPreExistingTasksAndAppendsNewOnesInAuthoredOrder()

    Create_InsertAtStart_PrependsNewTasksInAuthoredOrderBeforePreExistingOnes()

    Declaration
    public void Create_InsertAtStart_PrependsNewTasksInAuthoredOrderBeforePreExistingOnes()

    Create_MixedRows_PreservesAuthoredOrderAcrossBothKinds()

    Declaration
    public void Create_MixedRows_PreservesAuthoredOrderAcrossBothKinds()

    Create_NewInstallTaskRowWithBlankMethodName_FailsWithoutCreatingAnything()

    Declaration
    public void Create_NewInstallTaskRowWithBlankMethodName_FailsWithoutCreatingAnything()

    Create_NewInstallTaskRow_DelegatesToInstallTaskAuthoringFieldShape()

    Declaration
    public void Create_NewInstallTaskRow_DelegatesToInstallTaskAuthoringFieldShape()

    Create_OutputFolderRemovedFromDiskAfterCache_RollsBackTheProfile()

    Shape 1 — a BRAND-NEW profile whose own creation fails: the output folder is valid in Unity's cache but has been removed from disk directly, so AssetDatabase.CreateAsset logs the native "Parent directory must exist" error and SettingsAssetAuthoring.VerifyAssetWasWrittenToDisk throws — mirrors GameModeSettingsCreatorTests.Create_StaleCachedFolderRemovedFromDisk_RollsBackAndReportsTheNativeError's exact technique. Every created path (here: just the profile's own, since it fails before any task asset is materialized) must be rolled back.

    Declaration
    public void Create_OutputFolderRemovedFromDiskAfterCache_RollsBackTheProfile()

    Create_RegisterAsAddressablesFalse_LeavesAddressablesUntouched()

    Declaration
    public void Create_RegisterAsAddressablesFalse_LeavesAddressablesUntouched()

    Create_RegisterAsAddressablesTrue_TagsBothProfileAndNewTaskAssetWithModuleInitializationPipeline()

    Declaration
    public void Create_RegisterAsAddressablesTrue_TagsBothProfileAndNewTaskAssetWithModuleInitializationPipeline()

    Create_UpdatingExistingProfile_PreservesTheOriginalGuid()

    Declaration
    public void Create_UpdatingExistingProfile_PreservesTheOriginalGuid()

    Create_ValidInput_AssignsANonEmptyGuidToTheProfile()

    Declaration
    public void Create_ValidInput_AssignsANonEmptyGuidToTheProfile()

    Create_ValidInput_CreatesProfileWithOrderedInstallTasks()

    Declaration
    public void Create_ValidInput_CreatesProfileWithOrderedInstallTasks()

    PreviewFinalTaskOrder_ExistingProfilePlusNewRows_ProjectsExistingFirstWhenInsertingAtEnd()

    Declaration
    public void PreviewFinalTaskOrder_ExistingProfilePlusNewRows_ProjectsExistingFirstWhenInsertingAtEnd()

    PreviewFinalTaskOrder_ExistingProfilePlusNewRows_ProjectsNewRowsFirstWhenInsertingAtStart()

    Declaration
    public void PreviewFinalTaskOrder_ExistingProfilePlusNewRows_ProjectsNewRowsFirstWhenInsertingAtStart()

    PreviewFinalTaskOrder_ExistingProfileTaskWithZeroWeight_NormalizesWeightMirroringRuntimeExecutor()

    PreviewFinalTaskOrder(Input) must normalize a non-positive weight the exact same way InitializationPipelineService.BuildPlan does (task.Weight <= 0f ? 1f : task.Weight) — otherwise the Preview step's reached-progress percentage could report a value the real boot would never produce for a zero-weight task (a non-positive total-weight edge case the underlying Simulate(IReadOnlyList<InitializationPipelineStep>, IReadOnlyList<bool>) itself treats specially). Uses an EXISTING profile task (authored outside this run) with Weight forced to 0f — the projection's own per-row default for a brand-new install task is already the hardcoded 1f, so only the existing-task path can actually exercise a non-positive input.

    Declaration
    public void PreviewFinalTaskOrder_ExistingProfileTaskWithZeroWeight_NormalizesWeightMirroringRuntimeExecutor()

    PreviewFinalTaskOrder_NeverMutatesTheProject()

    Declaration
    public void PreviewFinalTaskOrder_NeverMutatesTheProject()

    Preview_ExistingProfile_ReportsNotNewWithItsRealPath()

    Declaration
    public void Preview_ExistingProfile_ReportsNotNewWithItsRealPath()

    Preview_NeverMutatesTheProject()

    Declaration
    public void Preview_NeverMutatesTheProject()

    Preview_NullRowEntry_SkipsItInsteadOfThrowing()

    Declaration
    public void Preview_NullRowEntry_SkipsItInsteadOfThrowing()

    SetUp()

    Declaration
    public void SetUp()

    TearDown()

    Declaration
    public void TearDown()

    Validate_AgainstExistingProfile_AlreadyContainsExistingDefinition_Warns()

    Declaration
    public void Validate_AgainstExistingProfile_AlreadyContainsExistingDefinition_Warns()

    Validate_AgainstExistingProfile_AlreadyContainsInstallTask_Warns()

    Declaration
    public void Validate_AgainstExistingProfile_AlreadyContainsInstallTask_Warns()

    Validate_CaseVariantProfileId_IsRejectedBecauseAssetFileNamesCollide()

    Serenity Ids are case-sensitive, but a profile's Id also becomes its asset FILE NAME (NamingSanitizer.FileNameSafe), and file names are NOT case-sensitive on Windows/macOS. So 'profile_orange' and 'Profile_Orange' would collide on disk — one asset silently overwriting the other — even though they are different, unrelated Ids at runtime. Validate(Input) must reject this with an error (not merely warn), mirroring PrefetchPolicyCreator's own case-insensitive uniqueness check, and Create(Input) must refuse to run at all.

    Declaration
    public void Validate_CaseVariantProfileId_IsRejectedBecauseAssetFileNamesCollide()

    Validate_DuplicateExistingDefinitionWithinBatch_WarnsWithoutBlocking()

    Declaration
    public void Validate_DuplicateExistingDefinitionWithinBatch_WarnsWithoutBlocking()

    Validate_DuplicateMethodNameWithinBatch_WarnsWithoutBlocking()

    Declaration
    public void Validate_DuplicateMethodNameWithinBatch_WarnsWithoutBlocking()

    Validate_DuplicateProfileIdElsewhere_WarnsWithoutBlocking()

    Declaration
    public void Validate_DuplicateProfileIdElsewhere_WarnsWithoutBlocking()

    Validate_EmptyProfileId_ReturnsError()

    Declaration
    public void Validate_EmptyProfileId_ReturnsError()

    Validate_ExistingDefinitionRowWithNoAssetAssigned_ReturnsError()

    Declaration
    public void Validate_ExistingDefinitionRowWithNoAssetAssigned_ReturnsError()

    Validate_InvalidOutputFolderPath_ReturnsError()

    Declaration
    public void Validate_InvalidOutputFolderPath_ReturnsError()

    Validate_NewInstallTaskRowWithBlankMethodName_ReturnsErrorNamingTheUnresolvedTarget()

    Declaration
    public void Validate_NewInstallTaskRowWithBlankMethodName_ReturnsErrorNamingTheUnresolvedTarget()

    Validate_NullInput_ReturnsMissingInputError()

    Declaration
    public void Validate_NullInput_ReturnsMissingInputError()

    Validate_NullRowEntry_ReturnsErrorInsteadOfThrowing()

    Declaration
    public void Validate_NullRowEntry_ReturnsErrorInsteadOfThrowing()

    Validate_SameProfileIdInItsOwnFolder_IsExcludedFromTheDuplicateWarning()

    Declaration
    public void Validate_SameProfileIdInItsOwnFolder_IsExcludedFromTheDuplicateWarning()

    Validate_ZeroTasks_WarnsWithoutBlocking()

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