logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class StructuredBackendAssetInstallerTests

    EditMode tests for StructuredBackendAssetInstaller, built on real assets on disk because the contract is about what survives on disk when a run fails — which no in-memory double can answer.

    The first test is the one that matters: it is the reason this pipeline was collapsed into a single implementation. Four creators each carried their own copy of the park/replace/restore trio, and the asset that copy holds is the user's OWN backend, moved rather than copied — so a rollback-ordering mistake in any one of them destroys real project data with no second copy to recover from.

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

    Constructors

    StructuredBackendAssetInstallerTests()

    Declaration
    public StructuredBackendAssetInstallerTests()

    Methods

    Install_ABackendBuiltWithoutAnId_StampsTheIdItsFileNameStates()

    A wizard that writes a backend through the shared factory hands over an asset with no Id at all — which Serenity's own Health Check then reports to the author as a defect the wizard caused. The installer gives it the Id its file name already states.

    Declaration
    public void Install_ABackendBuiltWithoutAnId_StampsTheIdItsFileNameStates()

    Install_ABackendThatAlreadyCarriesAnId_KeepsIt()

    A caller that stamps its own Id keeps it: an explicit identity is never overwritten by a derived one.

    Declaration
    public void Install_ABackendThatAlreadyCarriesAnId_KeepsIt()

    Install_PreBuiltAssetOverload_WritesAndTracksTheGivenInstance()

    The pre-built-instance overload LeaderboardCreator uses, exercised the same way the factory-driven overload above is.

    Declaration
    public void Install_PreBuiltAssetOverload_WritesAndTracksTheGivenInstance()

    Install_ReplaceExistingWithNothingAtThePath_ParksNothing()

    Replacing a path with nothing standing at it must behave exactly like a fresh install: no park, because there was nothing there to park.

    Declaration
    public void Install_ReplaceExistingWithNothingAtThePath_ParksNothing()

    Install_WithoutAConflict_CreatesAndTracksTheBackend()

    Declaration
    public void Install_WithoutAConflict_CreatesAndTracksTheBackend()

    Install_WithoutReplaceExisting_RefusesToOverwriteAnOccupiedPath()

    A caller that never opted into replacing must never silently clobber whatever already occupies its target path — UnityEditor.AssetDatabase.CreateAsset(UnityEngine.Object,System.String) would otherwise overwrite it in place, with no park and no way back for the asset that used to be there.

    Declaration
    public void Install_WithoutReplaceExisting_RefusesToOverwriteAnOccupiedPath()

    OneTimeSetUp()

    Declaration
    public static void OneTimeSetUp()

    OneTimeTearDown()

    Declaration
    public static void OneTimeTearDown()

    ReplaceExistingBackend_WhenTheRunFailsAfterTheNewBackendIsCreated_LeavesTheOriginalBackendAtItsOriginalPathWithItsOriginalGuid()

    The regression this whole extraction exists for. A replace-existing run parks the user's backend instead of destroying it, so a failure anywhere after the replacement was created must hand that exact asset back — same path, same GUID (so every reference to it in the project still resolves), same field values — and leave no parked leftovers behind.

    Declaration
    public void ReplaceExistingBackend_WhenTheRunFailsAfterTheNewBackendIsCreated_LeavesTheOriginalBackendAtItsOriginalPathWithItsOriginalGuid()

    SetUp()

    Declaration
    public void SetUp()

    TearDown()

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