Class InstallTaskAuthoringTests
EditMode tests for Serenity.Global.Infrastructure.Editor.InitializationPipeline.InstallTaskAuthoring: task asset creation, profile insertion/removal
and duplicate-task detection. Every mutation happens against a temp folder and scratch
UnityInitializationPipelineProfile assets created via ScriptableObject.CreateInstance
— the project's real profile assets are never touched. Mirrors the temp-folder SetUp/TearDown pattern of
AsmdefReferenceWriterTests and GameSaveCreatorTests.
Inherited Members
Namespace: Serenity.Global.Infrastructure.Tests.Editor.InitializationPipeline
Assembly: Serenity.InitializationPipeline.Tests.Editor.dll
Syntax
public class InstallTaskAuthoringTests
Constructors
InstallTaskAuthoringTests()
Declaration
public InstallTaskAuthoringTests()
Methods
AnyProfileContainsInstallTask_WiredInAProjectOwnedProfile_ReturnsTrue()
Declaration
public void AnyProfileContainsInstallTask_WiredInAProjectOwnedProfile_ReturnsTrue()
AnyProfileContainsInstallTask_WiredOnlyInAPackageShippedProfile_ReturnsFalse()
Declaration
public void AnyProfileContainsInstallTask_WiredOnlyInAPackageShippedProfile_ReturnsFalse()
CreateInstallTaskAsset_BlankMethodName_ReturnsError()
Declaration
public void CreateInstallTaskAsset_BlankMethodName_ReturnsError()
CreateInstallTaskAsset_InvalidFolder_ReturnsErrorAndCreatesNoAsset()
Declaration
public void CreateInstallTaskAsset_InvalidFolder_ReturnsErrorAndCreatesNoAsset()
CreateInstallTaskAsset_ThenOpenedThroughEditor_StaysUndirtied()
A task this real wizard path (Serenity.Global.Infrastructure.Editor.InitializationPipeline.InstallTaskAuthoring.CreateInstallTaskAsset(System.String,System.String,System.String@)) creates
must carry the current signature for its target method from the moment it is created — never
requiring a later editor pass to fix a stale placeholder. Opening its editor right after creation
proves this end to end: nothing is left for the self-heal in
UnityReflectionCallTaskDefinitionEditor to repair.
Declaration
public void CreateInstallTaskAsset_ThenOpenedThroughEditor_StaysUndirtied()
CreateInstallTaskAsset_ValidInput_CreatesAssetWithExpectedFields()
Declaration
public void CreateInstallTaskAsset_ValidInput_CreatesAssetWithExpectedFields()
FindExistingInstallTask_ForeignTypeName_IsIgnored()
Declaration
public void FindExistingInstallTask_ForeignTypeName_IsIgnored()
FindExistingInstallTask_MatchingTaskExists_ReturnsItWithItsPath()
Declaration
public void FindExistingInstallTask_MatchingTaskExists_ReturnsItWithItsPath()
FindExistingInstallTask_MultipleMatches_ReturnsOrdinalFirstAndReportsAllPaths()
Declaration
public void FindExistingInstallTask_MultipleMatches_ReturnsOrdinalFirstAndReportsAllPaths()
FindExistingInstallTask_NoMatch_ReturnsNullWithEmptyAllPaths()
Declaration
public void FindExistingInstallTask_NoMatch_ReturnsNullWithEmptyAllPaths()
FindExistingInstallTask_ProjectOwnedSortsAfterAShippedSignatureMatch_ProjectOwnedWins()
A project-owned task must win over a package-shipped one with the same signature even when its own
path sorts AFTER the shipped one ordinally — the ordinal-first pick this method used to make would
return the shipped match here, which is exactly the bug: it only ever picked the project-owned
match by the accident of Assets/Game sorting before Assets/Serenity in the real
project.
Declaration
public void FindExistingInstallTask_ProjectOwnedSortsAfterAShippedSignatureMatch_ProjectOwnedWins()
FindProjectOwnedProfiles_ExcludesPackageShippedProfiles()
The project's own real shipped profiles live under Assets/Serenity —
Serenity.Global.Infrastructure.Editor.SerenityEditorPaths.AssetsRoot, one of the two Serenity.Global.Infrastructure.Editor.SerenityEditorPaths.PackageRoots
entries — so this exercises the exclusion against real content instead of a fabricated path.
Declaration
public void FindProjectOwnedProfiles_ExcludesPackageShippedProfiles()
FindProjectOwnedProfiles_IncludesAScratchProfileOutsideThePackageRoots()
Serenity.Global.Infrastructure.Tests.Editor.InitializationPipeline.InstallTaskAuthoringTests.TempFolder lives outside every Serenity.Global.Infrastructure.Editor.SerenityEditorPaths.PackageRoots entry,
so a profile created under it is project-owned. SerenityEditorPathsTests and
AddressablesOwnershipLabelsTests already pin the underlying path predicate for both
PackageRoots entries at the string level — this only needs to prove
Serenity.Global.Infrastructure.Editor.InitializationPipeline.InstallTaskAuthoring.FindProjectOwnedProfiles actually delegates to it.
Declaration
public void FindProjectOwnedProfiles_IncludesAScratchProfileOutsideThePackageRoots()
FindProjectOwnedProfiles_ObjectNamesSortOppositeOfPaths_OrdersByPathNotObjectName()
Serenity.Global.Infrastructure.Editor.InitializationPipeline.InstallTaskAuthoring.FindAllProfiles must order candidates by asset PATH (via
OrderByOwnership<T>(IEnumerable<T>, Func<T, bool>, Func<T, string>),
the same rule SettingsAssetAuthoring.OrderCandidatePaths uses), never by
UnityEngine.Object.name — a fixture where both scratch profiles' object names sort the
OPPOSITE way from their real file paths proves which one the ordering actually follows.
Declaration
public void FindProjectOwnedProfiles_ObjectNamesSortOppositeOfPaths_OrdersByPathNotObjectName()
FindThenInsert_ExistingTaskIsReused_NoNewAssetIsCreated()
Declaration
public void FindThenInsert_ExistingTaskIsReused_NoNewAssetIsCreated()
IndexOfInstallTask_MatchPresent_ReturnsItsPosition()
Declaration
public void IndexOfInstallTask_MatchPresent_ReturnsItsPosition()
IndexOfInstallTask_NoMatch_ReturnsMinusOne()
Declaration
public void IndexOfInstallTask_NoMatch_ReturnsMinusOne()
IndexOfInstallTask_NullProfileOrBlankMethod_ReturnsMinusOne()
Declaration
public void IndexOfInstallTask_NullProfileOrBlankMethod_ReturnsMinusOne()
InsertTaskIntoProfile_AtEnd_AppendsAfterExistingTasks()
Declaration
public void InsertTaskIntoProfile_AtEnd_AppendsAfterExistingTasks()
InsertTaskIntoProfile_AtMiddleIndex_InsertsBetweenExistingTasks()
Declaration
public void InsertTaskIntoProfile_AtMiddleIndex_InsertsBetweenExistingTasks()
InsertTaskIntoProfile_AtZero_InsertsAtTheFront()
Declaration
public void InsertTaskIntoProfile_AtZero_InsertsAtTheFront()
InsertTaskIntoProfile_DuplicateInstance_ReturnsFalseWithWarningAndLeavesListUnchanged()
Declaration
public void InsertTaskIntoProfile_DuplicateInstance_ReturnsFalseWithWarningAndLeavesListUnchanged()
InsertTaskIntoProfile_IndexBeyondCount_ClampsToEnd()
Declaration
public void InsertTaskIntoProfile_IndexBeyondCount_ClampsToEnd()
InsertTaskIntoProfile_MarksProfileDirty()
Declaration
public void InsertTaskIntoProfile_MarksProfileDirty()
InsertTaskIntoProfile_NegativeIndex_ClampsToFront()
Declaration
public void InsertTaskIntoProfile_NegativeIndex_ClampsToFront()
IsLikelyAuthoredProfile_EmptyProfileAmongSeveral_ReturnsFalse()
Declaration
public void IsLikelyAuthoredProfile_EmptyProfileAmongSeveral_ReturnsFalse()
IsLikelyAuthoredProfile_FewerTasksThanAnotherProfile_ReturnsFalse()
Declaration
public void IsLikelyAuthoredProfile_FewerTasksThanAnotherProfile_ReturnsFalse()
IsLikelyAuthoredProfile_HasTheMostTasksAmongSeveral_ReturnsTrue()
Declaration
public void IsLikelyAuthoredProfile_HasTheMostTasksAmongSeveral_ReturnsTrue()
IsLikelyAuthoredProfile_NullProfileOrEmptyProfileList_ReturnsFalse()
Declaration
public void IsLikelyAuthoredProfile_NullProfileOrEmptyProfileList_ReturnsFalse()
IsLikelyAuthoredProfile_OnlyProfileInTheProject_ReturnsTrueEvenWhenEmpty()
Declaration
public void IsLikelyAuthoredProfile_OnlyProfileInTheProject_ReturnsTrueEvenWhenEmpty()
IsLikelyAuthoredProfile_TiedTaskCounts_BothDefaultToChecked()
A tie for the most tasks is not disambiguated — every profile tied for the max qualifies, so two equally-authored profiles both default to checked rather than the rule arbitrarily picking one.
Declaration
public void IsLikelyAuthoredProfile_TiedTaskCounts_BothDefaultToChecked()
MoveTaskIntoPosition_AfterSeveralAnchorsFarApart_LandsAfterTheLastOfThem()
Declaration
public void MoveTaskIntoPosition_AfterSeveralAnchorsFarApart_LandsAfterTheLastOfThem()
MoveTaskIntoPosition_AnchorAbsent_LeavesTheListAloneAtTheResolvedEndOfList()
Declaration
public void MoveTaskIntoPosition_AnchorAbsent_LeavesTheListAloneAtTheResolvedEndOfList()
MoveTaskIntoPosition_BeforeTheFirstOfSeveralAnchors_LandsAheadOfBoth()
Declaration
public void MoveTaskIntoPosition_BeforeTheFirstOfSeveralAnchors_LandsAheadOfBoth()
MoveTaskIntoPosition_CalledTwice_IsIdempotent()
Declaration
public void MoveTaskIntoPosition_CalledTwice_IsIdempotent()
MoveTaskIntoPosition_MovedTask_KeepsItsSerializedState()
A task carries no enabled flag — neither UnityTaskDefinition nor the profile declares one — so everything a reorder could lose is the serialized state asserted here.
Declaration
public void MoveTaskIntoPosition_MovedTask_KeepsItsSerializedState()
MoveTaskIntoPosition_ProfileDoesNotCarryTheTask_ReportsItAndChangesNothing()
Declaration
public void MoveTaskIntoPosition_ProfileDoesNotCarryTheTask_ReportsItAndChangesNothing()
MoveTaskIntoPosition_TaskAlreadyInPosition_ReportsNoMoveAndLeavesTheProfileClean()
Declaration
public void MoveTaskIntoPosition_TaskAlreadyInPosition_ReportsNoMoveAndLeavesTheProfileClean()
OneTimeTearDown()
Declaration
public void OneTimeTearDown()
ProfileContainsInstallTask_AssemblyQualifiedTypeNameVariant_StillMatchesByPrefix()
Declaration
public void ProfileContainsInstallTask_AssemblyQualifiedTypeNameVariant_StillMatchesByPrefix()
ProfileContainsInstallTask_DifferentMethodName_ReturnsFalse()
Declaration
public void ProfileContainsInstallTask_DifferentMethodName_ReturnsFalse()
ProfileContainsInstallTask_DifferentTaskTypeEntirely_ReturnsFalse()
Declaration
public void ProfileContainsInstallTask_DifferentTaskTypeEntirely_ReturnsFalse()
ProfileContainsInstallTask_EmptyProfile_ReturnsFalse()
Declaration
public void ProfileContainsInstallTask_EmptyProfile_ReturnsFalse()
ProfileContainsInstallTask_MatchingMethodAndInstallerType_ReturnsTrue()
Declaration
public void ProfileContainsInstallTask_MatchingMethodAndInstallerType_ReturnsTrue()
ProfileContainsInstallTask_NullProfile_ReturnsFalse()
Declaration
public void ProfileContainsInstallTask_NullProfile_ReturnsFalse()
ProfileContainsInstallTask_StepShapedTaskWithAShippedAssetForItsMethodName_ReturnsTrue()
The bare method-name overload now recognizes the shipped per-module-step shape too, because
Serenity.Global.Infrastructure.Editor.InitializationPipeline.InstallTaskAuthoring.SignaturesForInstallerMethod(System.String) reads it straight off the real
shipped Assets/Serenity/Media/Global/Tasks/InstallAchievements.asset — this fixture task is
shaped exactly like that asset, but lives in the temp profile, never the shipped one.
Declaration
public void ProfileContainsInstallTask_StepShapedTaskWithAShippedAssetForItsMethodName_ReturnsTrue()
ProjectOwnedProfilePathsByInstallMethodName_ObjectNameDiffersFromItsFileName_ReturnsTheFilePathNeverTheObjectName()
A profile's serialized object name (UnityEngine.Object.name, m_Name) can drift from
the actual file name on disk — e.g. a case-only rename a case-insensitive filesystem does not force
Unity to notice — so a wizard naming a wired profile by its object name can show the reader a name
that does not match the real file. Every caller must name a profile by its project-relative asset
PATH, which UnityEditor.AssetDatabase.GetAssetPath(UnityEngine.Object) always resolves against the file the
AssetDatabase actually tracks, regardless of what .name currently holds.
Declaration
public void ProjectOwnedProfilePathsByInstallMethodName_ObjectNameDiffersFromItsFileName_ReturnsTheFilePathNeverTheObjectName()
ProjectOwnedProfilePathsByInstallMethodName_UnwiredMethod_ReturnsEmptyList()
Declaration
public void ProjectOwnedProfilePathsByInstallMethodName_UnwiredMethod_ReturnsEmptyList()
ProjectOwnedProfilePathsByInstallMethodName_WiredMethod_NamesTheOwningProfileByItsAssetPath()
Declaration
public void ProjectOwnedProfilePathsByInstallMethodName_WiredMethod_NamesTheOwningProfileByItsAssetPath()
RemoveTaskFromProfile_NullProfileOrTask_DoesNotThrow()
Declaration
public void RemoveTaskFromProfile_NullProfileOrTask_DoesNotThrow()
RemoveTaskFromProfile_RemovesTheTaskAndMarksDirty()
Declaration
public void RemoveTaskFromProfile_RemovesTheTaskAndMarksDirty()
ResolveDefaultInsertIndexAfter_AnchorIsLastTask_ClampsToEndOfListIndex()
Declaration
public void ResolveDefaultInsertIndexAfter_AnchorIsLastTask_ClampsToEndOfListIndex()
ResolveDefaultInsertIndexAfter_BothAnchorsPresent_ReturnsAfterTheLastOne()
Declaration
public void ResolveDefaultInsertIndexAfter_BothAnchorsPresent_ReturnsAfterTheLastOne()
ResolveDefaultInsertIndexAfter_GameModeAbsentForAPlacementOnlyModule_ReturnsAfterTheLatestPresentFallbackAnchor()
Declaration
public void ResolveDefaultInsertIndexAfter_GameModeAbsentForAPlacementOnlyModule_ReturnsAfterTheLatestPresentFallbackAnchor()
ResolveDefaultInsertIndexAfter_NoAnchorPresent_ReturnsEndOfList()
Declaration
public void ResolveDefaultInsertIndexAfter_NoAnchorPresent_ReturnsEndOfList()
ResolveDefaultInsertIndexAfter_OneAnchorPresent_ReturnsAfterIt()
Declaration
public void ResolveDefaultInsertIndexAfter_OneAnchorPresent_ReturnsAfterIt()
ResolveDefaultInsertIndex_HintPresentInProfile_ReturnsThatTaskPosition()
Declaration
public void ResolveDefaultInsertIndex_HintPresentInProfile_ReturnsThatTaskPosition()
ResolveDefaultInsertIndex_NoHintOrHintAbsent_ReturnsEndOfList()
Declaration
public void ResolveDefaultInsertIndex_NoHintOrHintAbsent_ReturnsEndOfList()
ResolveDefaultTaskFolder_NoUserAuthoredTasks_ReturnsTheConventionFolder()
Declaration
public void ResolveDefaultTaskFolder_NoUserAuthoredTasks_ReturnsTheConventionFolder()
SetUp()
Declaration
public void SetUp()
TearDown()
Declaration
public void TearDown()