Class GameCameraSettingsCreatorTests
EditMode tests for GameCameraSettingsCreator. Every test targets a fixture asset path
under a private temp folder via Input.SettingsAssetPath — the real project's own
UnityGameCameraSettings asset(s), if any, are never touched, so these tests stay
hermetic regardless of what the project already has configured.
Inherited Members
Namespace: Serenity.GameCamera.Tests.Editor.Builder
Assembly: Serenity.GameCamera.Tests.Editor.dll
Syntax
public class GameCameraSettingsCreatorTests
Constructors
GameCameraSettingsCreatorTests()
Declaration
public GameCameraSettingsCreatorTests()
Methods
Create_EmptyId_FailsWithoutCreatingAnyAsset()
Declaration
public void Create_EmptyId_FailsWithoutCreatingAnyAsset()
Create_ExistingAssetAtExplicitPath_UpdatesItInPlaceInsteadOfCreatingANewOne()
Declaration
public void Create_ExistingAssetAtExplicitPath_UpdatesItInPlaceInsteadOfCreatingANewOne()
Create_ExistingAssetFileRemovedBeforeSecondRun_RollsBackTheAppliedFieldMutation()
Exercises the resolve-or-edit rollback path specifically: an already-existing asset gets its fields mutated in memory, then the pre-persist disk check fails (the settings file was removed from disk after the first Create() call). The mutation must be rolled back to its pre-call values, not just reported as failed.
Asserts against settingsBeforeSecondRun — the SAME C# object instance resolved right after
the first, successful Create() call — rather than re-resolving via a second
UnityEditor.AssetDatabase.LoadAssetAtPath``1(System.String) call after the failing one. The rollback's own
UnityEditor.AssetDatabase.Refresh could plausibly notice the deleted backing file and drop the
GUID-to-asset mapping; reading the already-held reference's fields sidesteps that uncertainty
entirely, since GameCameraSettingsCreator's
restore mutates the very instance the wizard already resolved, not a freshly re-loaded one.
Declaration
public void Create_ExistingAssetFileRemovedBeforeSecondRun_RollsBackTheAppliedFieldMutation()
Create_NestedOutputFolderDoesNotExistYet_CreatesTheFullChainAndTheAsset()
Declaration
public void Create_NestedOutputFolderDoesNotExistYet_CreatesTheFullChainAndTheAsset()
Create_RegisterAsAddressablesFalse_LeavesAddressablesUntouched()
Declaration
public void Create_RegisterAsAddressablesFalse_LeavesAddressablesUntouched()
Create_RegisterAsAddressablesTrue_RegistersTheCreatedAsset()
Declaration
public void Create_RegisterAsAddressablesTrue_RegistersTheCreatedAsset()
Create_StaleFolderCacheOnFreshCreation_RollsBackAndLeavesNothing()
Declaration
public void Create_StaleFolderCacheOnFreshCreation_RollsBackAndLeavesNothing()
Create_ValidInput_CreatesAssetWithConfiguredValues()
Declaration
public void Create_ValidInput_CreatesAssetWithConfiguredValues()
SetUp()
Declaration
public void SetUp()
TearDown()
Declaration
public void TearDown()
Validate_AssetAlreadyExistsAtTheExactPath_IsValidForAnUpdateInsteadOfAnError()
Declaration
public void Validate_AssetAlreadyExistsAtTheExactPath_IsValidForAnUpdateInsteadOfAnError()
Validate_EmptyId_ReturnsError()
Declaration
public void Validate_EmptyId_ReturnsError()
Validate_MultipleSettingsAssetsExistInProject_WarnsAboutAmbiguityWithoutBlocking()
Declaration
public void Validate_MultipleSettingsAssetsExistInProject_WarnsAboutAmbiguityWithoutBlocking()