logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SystemAdoptionRunnerTests

    EditMode tests for SystemAdoptionRunner and SystemAdoptionVerifier. Every fixture lives under a scratch package folder and a scratch output root, both owned by a ScratchAssetFixture created in SetUp() and disposed in TearDown().

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

    Constructors

    SystemAdoptionRunnerTests()

    Declaration
    public SystemAdoptionRunnerTests()

    Methods

    SetUp()

    Declaration
    public void SetUp()

    TearDown()

    Declaration
    public void TearDown()

    TryAdopt_CollectionMember_GetsRenamedIdAndNewGuid()

    Declaration
    public void TryAdopt_CollectionMember_GetsRenamedIdAndNewGuid()

    TryAdopt_DestinationAlreadyExists_RollsBackAndLeavesNoNewFiles()

    Declaration
    public void TryAdopt_DestinationAlreadyExists_RollsBackAndLeavesNoNewFiles()

    TryAdopt_MultiRootPlanFailingMidway_RollsBackEveryRoot()

    Declaration
    public void TryAdopt_MultiRootPlanFailingMidway_RollsBackEveryRoot()

    TryAdopt_MultiRootPlan_ClonesEveryRootInOneTransaction()

    Declaration
    public void TryAdopt_MultiRootPlan_ClonesEveryRootInOneTransaction()

    TryAdopt_ReportsEveryRename()

    Declaration
    public void TryAdopt_ReportsEveryRename()

    TryAdopt_SecondSystemSharingASibling_ReusesTheExistingCloneInsteadOfRecloningIt()

    Declaration
    public void TryAdopt_SecondSystemSharingASibling_ReusesTheExistingCloneInsteadOfRecloningIt()

    TryAdopt_SettingsReferencingASibling_ClonesBothAndRenamesIdentity()

    Declaration
    public void TryAdopt_SettingsReferencingASibling_ClonesBothAndRenamesIdentity()

    TryAdopt_ShippedUiSettings_LeavesNoPackageReference()

    Regression test for the shipped Ui adoption dragging a package reference along: before UnityAssetSetCloner stopped treating .anim/.controller as binary, an adopted clone of Serenity.CreateGame.Tests.Editor.SystemAdoptionRunnerTests.RealUiSettingsPath kept its animator controllers pointing at the package's AnimatedThemeHighlightColorLoop.anim because the reference-rewrite pass skipped those two extensions entirely. Adopts the real shipped Ui settings and asserts Verify reports nothing. Also covers invariant 1 (the clone gets a renamed Id, "UiSettings_Project") and the miss case: with nothing else adopted alongside it, InitialViewId/ScaleKey/FontSizeKey have no adopted counterpart to resolve against yet and must be left exactly as shipped.

    Declaration
    public void TryAdopt_ShippedUiSettings_LeavesNoPackageReference()

    TryAdopt_SingletonSettings_AlsoGetsARenamedId()

    Declaration
    public void TryAdopt_SingletonSettings_AlsoGetsARenamedId()

    Verify_AfterAFullAdoption_ReturnsNoViolations()

    Declaration
    public void Verify_AfterAFullAdoption_ReturnsNoViolations()

    Verify_AfterAdoptionWithAnExcludedInstallerDependency_ReportsItAsAViolation()

    The only remaining exclusion since UnityPrefabFoundationIdentityRegenerator started cloning every OTHER identity-carrying prefab is the shipped composition-root installer prefab itself (Serenity.CreateGame.Infrastructure.Editor.CreateGameScenePaths.SerenityInstallerPrefabPath) — see SystemAdoptionPlanner's "IsShippedInstallerPrefab" rule. This test references that real shipped asset from the scratch settings, adopts, and asserts Verify still reports it as an unadopted package dependency; it must never be cloned or written under Serenity.Global.Infrastructure.Editor.SerenityEditorPaths.MediaRoot. It asserts membership rather than an exact violation count: the installer prefab itself carries many further package-content references (settings definitions, log profiles, the initialization scene), each of which Verify's own recursive dependency walk also reports as a violation, independently of this exclusion.

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