Class GameSaveCreatorTests
EditMode tests for GameSaveCreator. Every test targets a fixture
UnityGameSaveSettings asset under a private temp folder via Input.SettingsAssetPath
— the real project-wide single settings asset (used by the production wizard) is never touched, so
these tests stay hermetic regardless of what the project already has configured. Mirrors
Serenity.GameProgress.Tests.Editor.Builder.GameProgressCreatorTests.
Inherited Members
Namespace: Serenity.GameSave.Tests.Editor.Builder
Assembly: Serenity.GameSave.Tests.Editor.dll
Syntax
public class GameSaveCreatorTests
Constructors
GameSaveCreatorTests()
Declaration
public GameSaveCreatorTests()
Methods
Create_BackendWithAddressablesRegistration_RegistersTheCreatedAssets()
Declaration
public void Create_BackendWithAddressablesRegistration_RegistersTheCreatedAssets()
Create_ExistingBackend_IsNotReplacedWithoutTheFlag()
Declaration
public void Create_ExistingBackend_IsNotReplacedWithoutTheFlag()
Create_ExistingBackend_IsReplacedWhenFlagIsSet()
Declaration
public void Create_ExistingBackend_IsReplacedWhenFlagIsSet()
Create_ExistingSettingsAsset_EditsInsteadOfDuplicatingTheAsset()
Declaration
public void Create_ExistingSettingsAsset_EditsInsteadOfDuplicatingTheAsset()
Create_ExistingSettings_DoesNotRewriteTheTableOrCollectionName()
Declaration
public void Create_ExistingSettings_DoesNotRewriteTheTableOrCollectionName()
Create_ExistingSettings_UpdatesSlotCountAndRouteCheckpointsFlag()
Declaration
public void Create_ExistingSettings_UpdatesSlotCountAndRouteCheckpointsFlag()
Create_NoExistingSettingsAsset_CreatesOneAtTheGivenPath()
Declaration
public void Create_NoExistingSettingsAsset_CreatesOneAtTheGivenPath()
Create_RegisterAsAddressablesFalse_LeavesAddressablesUntouched()
Declaration
public void Create_RegisterAsAddressablesFalse_LeavesAddressablesUntouched()
Create_ReplaceExistingBackendAtSameName_Succeeds_ProducesOneCleanAssetWithNewConfig()
Enables the non-destructive "Replace Existing Backend" flow at the SAME asset name (rename-to-temp): the old backend is relocated, never destroyed, until the whole run succeeds. Also switches backend KIND (Http to Sqlite) to prove the replacement can be a different concrete type at the same path.
Declaration
public void Create_ReplaceExistingBackendAtSameName_Succeeds_ProducesOneCleanAssetWithNewConfig()
Create_ReplaceExistingBackendAtSameName_ThenLaterStepFails_RestoresTheOriginalBackendIntact()
Hand-builds the exact mid-run state a same-name replace leaves behind — the original backend moved aside to a temp path (rename-to-temp, not destroyed) and a brand-new replacement created at the original path — then invokes the private RollBack directly, mirroring RollBack_RestoresBackendReferenceBeforeDeletingTheReplacementBackend() extended with the movedBackends list. GameSaveCreator has no asset-creation step after the backend, so there is no black-box way to force a genuine later-stage failure once the replacement backend has been created.
Declaration
public void Create_ReplaceExistingBackendAtSameName_ThenLaterStepFails_RestoresTheOriginalBackendIntact()
Create_SettingsFolderDoesNotExistYet_CreatesTheFolderChainAndTheSettingsAsset()
Declaration
public void Create_SettingsFolderDoesNotExistYet_CreatesTheFolderChainAndTheSettingsAsset()
Create_WithHttpBackend_CreatesAndLinksTheSharedBackendAsset()
Declaration
public void Create_WithHttpBackend_CreatesAndLinksTheSharedBackendAsset()
Create_WithPlayerPrefsBackend_CreatesAndLinksAFieldlessSharedBackendAsset()
Declaration
public void Create_WithPlayerPrefsBackend_CreatesAndLinksAFieldlessSharedBackendAsset()
Create_WithSqliteBackend_SetsTheDatabaseFileNameOnTheBackendAsset()
Declaration
public void Create_WithSqliteBackend_SetsTheDatabaseFileNameOnTheBackendAsset()
RollBack_RestoresBackendReferenceBeforeDeletingTheReplacementBackend()
Regression test for the rollback-ordering bug: RollBack used to delete every created asset
BEFORE restoring the settings asset's prior Backend reference. Since AssetDatabase.DeleteAsset
silently skips deleting an asset that a dirty in-memory object still references, deleting a newly
created replacement backend while the settings asset still pointed at it stranded the backend on disk.
GameSaveCreator has no asset-creation step after the backend (unlike
LeaderboardCreator's View step), so there is no black-box way to force a failure once the new
backend has been created and assigned; this test instead invokes the private RollBack method
via reflection to reproduce the exact hazardous state directly.
Declaration
public void RollBack_RestoresBackendReferenceBeforeDeletingTheReplacementBackend()
SetUp()
Declaration
public void SetUp()
TearDown()
Declaration
public void TearDown()
ValidateIdentity_EmptyAssetName_ReturnsError()
Declaration
public void ValidateIdentity_EmptyAssetName_ReturnsError()
ValidateIdentity_SlotCountLessThanOne_ReturnsError()
Declaration
public void ValidateIdentity_SlotCountLessThanOne_ReturnsError()
Validate_BackendFolderEmpty_ReturnsError()
Declaration
public void Validate_BackendFolderEmpty_ReturnsError()
Validate_DatabaseBackendWithoutHostOrConnectionString_ReturnsError()
Declaration
public void Validate_DatabaseBackendWithoutHostOrConnectionString_ReturnsError()
Validate_HttpBackendMissingBaseUrl_ReturnsError()
Declaration
public void Validate_HttpBackendMissingBaseUrl_ReturnsError()