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.
Inherited Members
Namespace: Serenity.StructuredPersistence.Tests.Editor
Assembly: Serenity.StructuredPersistence.Tests.Editor.dll
Syntax
public class StructuredBackendAssetInstallerTests
Constructors
StructuredBackendAssetInstallerTests()
Declaration
public StructuredBackendAssetInstallerTests()
Methods
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()