Class SerenityAudioRegistrationValidatorTests
Tests for Serenity.Global.Infrastructure.Editor.Validation.SerenityAudioRegistrationValidator: an audio clip definition that exists as an
asset but is absent from its selectable game-settings registry must be flagged, and the fix API must
resolve it. Builds a throwaway registry via ScriptableObject.CreateInstance(string) because
UnityGameSettingsDefinition has no assembly definition of its own — see
Serenity.Global.Infrastructure.Editor.Validation.SerenityAudioRegistrationValidator's class remarks — and targets it explicitly through the
two-registry FixByRegistering overload so the test never touches the project's real
Audio_SoundToTrigger asset.
Inherited Members
Namespace: Serenity.UnityValidation.Tests.Editor
Assembly: Serenity.UnityValidation.Tests.Editor.dll
Syntax
public class SerenityAudioRegistrationValidatorTests
Constructors
SerenityAudioRegistrationValidatorTests()
Declaration
public SerenityAudioRegistrationValidatorTests()
Methods
FixByRegistering_ThenRerun_NoLongerReported_AndSecondFixIsNoOp()
Registers into the PROJECT-owned registry: registration refuses a registry the package ships, because appending to it is undone by the next package update along with every clip registered since — see FixByRegistering_WithOnlyAShippedRegistry_RegistersNothing().
Declaration
public void FixByRegistering_ThenRerun_NoLongerReported_AndSecondFixIsNoOp()
FixByRegistering_WithAShippedAndAProjectOwnedRegistry_WritesIntoTheProjectOwnedOne()
The project holding both the shipped registry template and its own copy — what Adopt All produces — used to make every automatic registration give up as "ambiguous", so a freshly imported clip was silently never registered and never played. Ownership decides, exactly as it does at boot.
Declaration
public void FixByRegistering_WithAShippedAndAProjectOwnedRegistry_WritesIntoTheProjectOwnedOne()
FixByRegistering_WithOnlyAShippedRegistry_RegistersNothing()
With the shipped fixture registry as the project's only one, registration writes nothing and says so: the clip stays reported, because appending it to a file the next package update overwrites would lose it — and lose every clip registered there since — while looking like success.
Declaration
public void FixByRegistering_WithOnlyAShippedRegistry_RegistersNothing()
Run_UnregisteredClip_ReportsExactlyOneWarning()
Declaration
public void Run_UnregisteredClip_ReportsExactlyOneWarning()
Run_WithAShippedAndAProjectOwnedRegistry_ReportsNoAmbiguity()
The project's own registry beside the shipped template is exactly what Adopt All produces, and the ownership rule the runtime and registration both apply decides it — so it is not an ambiguity, and Validate Everything must not warn about the normal state of every adopted project.
Declaration
public void Run_WithAShippedAndAProjectOwnedRegistry_ReportsNoAmbiguity()
Run_WithTwoMatchingRegistries_ReportsAmbiguityWarning()
Declaration
public void Run_WithTwoMatchingRegistries_ReportsAmbiguityWarning()
Run_WithTwoProjectOwnedRegistries_ReportsTheAmbiguityNamingBoth()
Two registries the project owns are a real ambiguity: ownership cannot pick between them, so registration writes into neither. The warning names both project paths, the ones an author can act on.
Declaration
public void Run_WithTwoProjectOwnedRegistries_ReportsTheAmbiguityNamingBoth()
SetUp()
Declaration
public void SetUp()
TearDown()
Declaration
public void TearDown()