Class CreateAudioPlayerSettingsWindowUpdateInPlaceTests
CreateAudioPlayerSettingsWindow must seed Channels/Audio Mixer Group/Audio Game Settings/Ignore If Already Playing from the real asset an existing Channel Id resolves to, so an update-in-place run always reflects the asset's own data rather than the wizard's hardcoded fresh-create defaults. Also proves the same round-trip/reload/write-boundary contract every other by-Id wizard (Character, PlayerInput) carries, against a real UnityEngine.Audio.AudioMixerGroup and a real UnityAudioGameSettingsDefinition reference.
Inherited Members
Namespace: Serenity.AudioPlayer.Tests.Editor.Builder
Assembly: Serenity.Audio.SettingsCreator.Tests.Editor.dll
Syntax
public class CreateAudioPlayerSettingsWindowUpdateInPlaceTests
Constructors
CreateAudioPlayerSettingsWindowUpdateInPlaceTests()
Declaration
public CreateAudioPlayerSettingsWindowUpdateInPlaceTests()
Methods
IdentityStep_AnotherAssetAtThePlannedPath_BlocksNamingTheOccupantsId()
W5B-5: a different asset already sitting at the planned path is known the moment the Id and the folder are typed, so the Identity step names it and blocks, and Summary never plans a file it cannot write.
Declaration
public void IdentityStep_AnotherAssetAtThePlannedPath_BlocksNamingTheOccupantsId()
OneTimeTearDown()
Declaration
public void OneTimeTearDown()
Open_UntouchedDefaultChannelIdCollidesWithARealChannel_ResolvesToUpdateAndSeedsFromIt()
The window's own hardcoded default Channel Id ("SFX") resolves against a real existing channel —
and seeds the draft from it — the moment the window opens, with ZERO keystrokes, not only after the
Identity step's own change-check runs following an edit: Serenity.Global.Infrastructure.Editor.SerenityWizardByIdAssetField`1.Retarget(System.String)
runs from Open() itself, against whatever Id/folder are
set at that point, including a completely untouched default — so PrimaryButtonLabel reads
"Update" and confirming edits the real channel in place instead of clobbering it.
Declaration
public void Open_UntouchedDefaultChannelIdCollidesWithARealChannel_ResolvesToUpdateAndSeedsFromIt()
RunPrimaryActionForTests_AfterEditingOneUnrelatedScalarField_KeepsReferencesIntact()
One-scalar-edit isolation: editing ONLY Channels on an update run must leave the Audio Mixer Group reference, the Audio Game Settings reference, Type and Ignore If Already Playing untouched.
Declaration
public void RunPrimaryActionForTests_AfterEditingOneUnrelatedScalarField_KeepsReferencesIntact()
RunPrimaryActionForTests_AfterSourceAssetDeletedOnDisk_DoesNotThrowAndDoesNotOverwriteAnUnrelatedAsset()
Declaration
public void RunPrimaryActionForTests_AfterSourceAssetDeletedOnDisk_DoesNotThrowAndDoesNotOverwriteAnUnrelatedAsset()
RunPrimaryActionForTests_AfterTypoDetourAndReturnToSameId_ChangesOnlyTheEditedFieldOnThatAsset()
The zero-other-edits half of the Id typo detour: after a detour through a free Id and a return to the SAME existing Id, confirming must change ONLY the edited field on the real asset — never any other field, and never create a second asset.
Declaration
public void RunPrimaryActionForTests_AfterTypoDetourAndReturnToSameId_ChangesOnlyTheEditedFieldOnThatAsset()
RunPrimaryActionForTests_AssetCreatedExternallyAtPlannedPathAfterValidation_IsRefusedAndExistingAssetUntouched()
Declaration
public void RunPrimaryActionForTests_AssetCreatedExternallyAtPlannedPathAfterValidation_IsRefusedAndExistingAssetUntouched()
RunPrimaryActionForTests_AssetCreatedExternallyAtPlannedPathAfterValidation_LeavesDiskAndLiveDraftUnchanged()
Forced commit failure: the same write-boundary collision as the test above, examined from
the caller-owned LIVE draft's own side — proves AudioPlayerSettingsCreator.CreateFromDraft's
draftRestore.Restore() puts the window's own long-lived Serenity.AudioPlayer.Infrastructure.Settings.Editor.Builder.CreateAudioPlayerSettingsWindow.DraftForTests
back to exactly its pre-call serialized state, not merely that the collider survives.
Declaration
public void RunPrimaryActionForTests_AssetCreatedExternallyAtPlannedPathAfterValidation_LeavesDiskAndLiveDraftUnchanged()
RunPrimaryActionForTests_CreateNew_ThenConfirmAgain_UpdatesTheJustCreatedAssetInPlace()
Declaration
public void RunPrimaryActionForTests_CreateNew_ThenConfirmAgain_UpdatesTheJustCreatedAssetInPlace()
RunPrimaryActionForTests_RefusedByAnotherAssetAtThePlannedPath_DoesNotReportAnUpdate()
W5B-5: a refused, rolled-back run updated nothing, so its outcome must not read as an update.
Declaration
public void RunPrimaryActionForTests_RefusedByAnotherAssetAtThePlannedPath_DoesNotReportAnUpdate()
RunPrimaryActionForTests_ZeroEditsAfterTypingAnExistingId_KeepsChannelsAndIgnoreFlagIntact()
The critical regression this fix closes: confirming an update run after only reopening the wizard (with no field re-entry at all) must never reset Channels back to the fresh-create default.
Declaration
public void RunPrimaryActionForTests_ZeroEditsAfterTypingAnExistingId_KeepsChannelsAndIgnoreFlagIntact()
SetIdForTests_ExistingId_DraftSurfacesTheAssetsOwnRoutingFields()
Declaration
public void SetIdForTests_ExistingId_DraftSurfacesTheAssetsOwnRoutingFields()
SetIdForTests_TypingAFreeIdAfterAnExisting_KeepsCurrentDraftValuesAndRebindsOnReturn()
Declaration
public void SetIdForTests_TypingAFreeIdAfterAnExisting_KeepsCurrentDraftValuesAndRebindsOnReturn()
SetIdForTests_ZeroEditsAfterTyping_LeavesEveryFieldIncludingReferencesUnchanged()
The comprehensive round-trip contract: every field on the real asset — Type, Channels, the real
UnityEngine.Audio.AudioMixerGroup reference, Ignore If Already Playing — is mutated away from its current
value where the generic walker can, then a zero-edit confirm must leave every one of them
byte-identical. Would FAIL against a version of CreateAudioPlayerSettingsWindow that
seeds only a subset of these fields, since the walker seeds EVERY serialized field it can mutate,
not only the ones this test happens to also assert on individually. Two fields the generic walker cannot mutate
generically are acknowledged here and proven directly elsewhere instead:
Channels is a uint — UnitySerializedFieldSeeds
only derives a scalar seed from bool/int/float/double/enum/LayerMask — proven directly by
RunPrimaryActionForTests_ZeroEditsAfterTypingAnExistingId_KeepsChannelsAndIgnoreFlagIntact()
and RunPrimaryActionForTests_AfterEditingOneUnrelatedScalarField_KeepsReferencesIntact();
audioGameSettings is a DIFFERENT reference type from the one
alternate the generic walker can seed in a single call — proven directly by
SetIdForTests_ExistingId_DraftSurfacesTheAssetsOwnRoutingFields() and
RunPrimaryActionForTests_AfterEditingOneUnrelatedScalarField_KeepsReferencesIntact() above.
Declaration
public void SetIdForTests_ZeroEditsAfterTyping_LeavesEveryFieldIncludingReferencesUnchanged()
SetUp()
Declaration
public void SetUp()
SimulateDomainReloadForTests_InEachOfTheThreeBindingStates_KeepsValuesAndBindingState()
Mirrors CreatePlayerInputWindowUpdateInPlaceTests.SimulateDomainReloadForTests_InEachOfTheThreeBindingStates:
a simulated domain reload must preserve both the draft's values AND its binding state (bound to A,
unbound, or bound to a different asset B) exactly as it was before the reload.
Declaration
public void SimulateDomainReloadForTests_InEachOfTheThreeBindingStates_KeepsValuesAndBindingState()
StartAnotherAudioPlayer_ThenTypingTheSameIdAgain_LoadsTheChannelAsItIsNow()
"Create another audio player" clears the Id and starts a new run; typing an existing channel's Id in that run is a new decision, so the draft must be loaded from the channel as it is now — not kept from the previous run, which would write that run's values over whatever changed on the channel since.
Declaration
public void StartAnotherAudioPlayer_ThenTypingTheSameIdAgain_LoadsTheChannelAsItIsNow()
TearDown()
Declaration
public void TearDown()