Namespace Serenity.UnityAudioPlayer.Tests.Infrastructure
Classes
CountingAudioRoomLocatorTests
Tests for Serenity.Tests.Shared.Audio.CountingAudioRoomLocator, the wrapper depth-cue tests lean on to prove no room is looked up when none can matter.
CountingOcclusionProbeTests
Tests for Serenity.Tests.Shared.Audio.CountingOcclusionProbe, the scripted probe depth-cue tests lean on: a scripted yes or no maps to full or no occlusion, a scripted amount wins, a scripted amount per question wins over all of them, and the questions are remembered.
FakeAudioRoomTests
Tests for Serenity.Tests.Shared.Audio.FakeAudioRoom, the box of space room tests lean on: it contains what lies in its box and lists the open portals it was given.
UnityAudioDepthCueActivationTests
A channel gets depth cues only when its settings carry a block with at least one cue on (low-pass or reverb) and it is not a MUSIC channel. Every refusal leaves no block behind, so a caller can never act on settings it was told to ignore.
UnityAudioDepthCueControllerDiagnosticsTests
What the Play Mode gizmo reads from a channel's controller: how many slots it follows, where the listener is, and for each positioned voice whether it is sounding, where it is, whether a wall is in the way and what cutoff the controller last computed.
UnityAudioDepthCueControllerDryReverbTests
A voice holds one of the capped reverb slots only while it is wet: a dry voice never takes a slot, a reverberated voice that stays dry for the whole window gives its slot back, and a wet voice the cap refuses asks again until a slot frees.
UnityAudioDepthCueControllerGradedOcclusionTests
Tests for the graded occlusion amount the depth-cue controller carries: with the default settings every per-frame output equals the all-or-nothing trajectory pinned below, a probed amount between 0 and 1 is smoothed, shapes the wet share and reads as occluded, and the closing time and the full detour length reach the voice and the probe.
UnityAudioDepthCueControllerNoListenerTests
A scene without an active UnityEngine.AudioListener skips the work that measures from it (distance, occlusion probes, the cue writes), logs the absence once through the listener cache, and still gives back the reverb of a voice that went silent, because that needs no listener.
UnityAudioDepthCueControllerPoolSyncTests
The audio source pool of a service can be replaced at any time (SetAudioSources is public), so the
controller must follow a pool that grows, shrinks or is swapped, and must never touch a destroyed source.
UnityAudioDepthCueControllerProbeTickTests
Tests for the probe side of Serenity.AudioPlayer.Infrastructure.Services.UnityAudioDepthCueController: the occlusion tick that runs about ten times per second, the accumulator that schedules it, and the way its answer reaches the smoothed cues. Probe answers and "is sounding" are stubbed, so no test depends on real physics or on audio playing. Each test clears the probe's call count after its plays, so only the calls it provokes are counted.
UnityAudioDepthCueControllerReactivationTests
A cue switched on or off in the settings while the game runs takes full effect on the next frame: the filters the flags need appear, those they no longer need go quiet, the volume the low-pass stops owning is handed back, and the reverb cap is decided again over the voices that are sounding. A voice that is not sounding is left alone.
UnityAudioDepthCueControllerReverbHysteresisTests
Two sources at almost the same distance never trade the only reverb slot back and forth, while a source that is clearly nearer still takes it.
UnityAudioDepthCueControllerReverbTests
The reverb half of Serenity.AudioPlayer.Infrastructure.Services.UnityAudioDepthCueController: every positioned play is admitted under the cap (nearest wins), then the reverb room level follows distance and occlusion. Probe answers and "is sounding" are stubbed, so no test depends on real physics or on audio playing.
UnityAudioDepthCueControllerRoomCoreTests
Tests for the depth-cue controller with rooms, on fake rooms: a voice behind a wall in a room with an open portal is heard through the portal (less occluded, a longer heard distance that drives the cutoff and the order under the reverb cap, and a route a snapshot reports), asks at most two occlusion questions per probe tick, never steps its heard distance when the route starts or ends, allocates nothing, and looks up no room when nothing can need one.
UnityAudioDepthCueControllerRoomDoorwayClearanceTests
How far the real probe lets a doorway read clear: the clearances around the source and the portal, a blocked best doorway, and a portal inside the wall.
UnityAudioDepthCueControllerRoomDoorwayCostTests
Tests for what the depth-cue controller costs in linecasts with the real occlusion probe against a closed box room: a voice without a room casts one ray per tick, and a routed voice on a static scene casts one for the straight line and one for the way to the doorway, every tick.
UnityAudioDepthCueControllerRoomDoorwayFallbackTests
Routing through a doorway whose front wall is a non-convex mesh, so the real probe casts extra rays behind it: the graded amount follows the way through the doorway, and the extra rays are cast on the first tick only, again when the listener moves beyond the reuse distance.
UnityAudioDepthCueControllerRoomDoorwayTests
Routing through the doorway of a closed box room, read by the real probe: the voice behind the wall is heard through the opening, its amount does not step across the sight line, and its heard distance glides when the route starts and ends.
UnityAudioDepthCueControllerRoomGatingTests
Tests for when the depth-cue controller asks the extra question about the way through a portal, on real rooms and portals: only while the straight line is occluded, exactly one of the listener and the source is inside a room, and that room has an open portal; and then the way to the portal must be less occluded. Everything else keeps the straight line and costs no extra question.
UnityAudioDepthCueControllerRoomRouteTests
Tests for how the depth-cue controller keeps a route through a room's portals: only the shortest portal is asked about, it stays chosen inside a margin and gives way beyond it, the heard distance glides through a switch, the way to the portal has a fallback memory of its own, a new play forgets the route, a voice that pauses keeps it, the emitter is never moved, and the cutoff and the reverb cap follow the path through the doorway.
UnityAudioDepthCueControllerTests
Tests for Serenity.AudioPlayer.Infrastructure.Services.UnityAudioDepthCueController: the per-play reset (positioned plays get an open, unoccluded low-pass; 2D plays get none) and the per-frame apply step that writes cutoff and volume. Probe answers and "is sounding" are stubbed, so no test depends on real physics or on audio playing.
UnityAudioDepthCueEndToEndTests
The whole path with nothing stubbed: a channel built by the factory, a real play through the service, real physics for the occlusion probe, and the ticker's controller driven past the point where the cues settle. The geometry sits far from the world origin so no other test's colliders can interfere.
UnityAudioDepthCueRoomEndToEndTests
The whole path with nothing stubbed, through a room: a channel built by the factory over the registry of the test, a real play through the service, the real occlusion probe against the walls of a closed box room with a doorway, and the controller driven past the point where the cues settle. The source behind the wall is muffled without the room and heard through the doorway with it, and its emitter never moves.
UnityAudioDepthCueRoomRouterTests
Tests for Serenity.AudioPlayer.Infrastructure.Services.UnityAudioDepthCueRoomRouter on fake rooms, fake portals and a scripted probe: a voice whose straight line is occluded is heard through the shortest open portal when exactly one of the listener and the source is inside a room and the way to the portal is less occluded; the leg outside the room is asked, for the shortest portal only; the route is kept inside a margin, the portal is kept inside another; a portal that is gone routes nothing; nothing is looked up when no room can matter; and the listener's room is looked up once per probe tick.
UnityAudioDepthCueRouteTests
Tests for Serenity.AudioPlayer.Infrastructure.Services.UnityAudioDepthCueRoute, the way one voice is heard through a portal: the extra metres on top of the straight line, smoothed with the occlusion opening constant in both directions so the heard distance never steps, exactly zero when the voice is not routed so the heard distance is then the straight one bit for bit, and kept across a portal switch. The route reads only the portal position it was given, never the portal object, so a portal destroyed in between cannot break it.
UnityAudioDepthCueTickerTests
The ticker is the controller's only driver: every frame it hands the controller the unscaled frame time and does nothing else. Time is frozen in the tests that matter, so a ticker reading scaled time would never advance.
UnityAudioDepthCueVoiceStateRouteTests
Tests for the route a depth-cue voice carries: it starts unrouted, its heard distance is the straight distance to its source until a route adds metres, it follows the route a step at a time, and it forgets the route and the portal-leg memory with the rest of the play state. The snapshot of a voice reports the route it was built with, unrouted unless it was given one.
UnityAudioListenerCacheTests
Tests for Serenity.AudioPlayer.Infrastructure.Services.UnityAudioListenerCache: a cached, throttled view of the active UnityEngine.AudioListener, with a clock injected so no test waits in real time.
UnityAudioOcclusionFallbackMemoryTests
Tests for Serenity.AudioPlayer.Infrastructure.Services.UnityAudioOcclusionFallbackMemory: a remembered blocked share is handed back only while the listener, the source and the blocking collider have each stayed within the reuse distance, the layers and the collider are the same, and it has not been reused too many times in a row.
UnityAudioPlayerClipDefinitionTests
Tests for the UnityAudioPlayerClipDefinition ScriptableObject and its explicit IAudioPlayerClipDefinition / IFoundationSettings implementations.
UnityAudioPlayerEmitterDtoTests
Tests for the Unity-specific emitter DTOs CreateUnityAudioPlayerEmitterInput and CreateUnityAudioPlayerEmitterOutput.
UnityAudioPlayerEmitterFactoryDepthCueTests
The emitter factory creates each depth-cue filter only when the channel opts in to that cue, never on a MUSIC channel and never for settings that carry no depth cues. The filters start disabled until a play enables them.
UnityAudioPlayerEmitterFactoryTests
Tests for UnityAudioPlayerEmitterFactory. Uses a real UnityAudioPlayerSettings with a NULL AudioMixerGroup so the factory's verification path stays on the (warning-only) happy branch: assigning null and reading back null keeps the assignment "retained", so no LogError is produced.
UnityAudioPlayerInstallerDepthCueTests
The installer's own path from a settings asset to a running channel: the settings it resolves from the composition root's wired references reach the service factory unchanged, so a depth-cue flag authored on the asset is exactly what decides whether the channel gets its ticker and its low-pass filters.
UnityAudioPlayerServiceFactoryDepthCueTests
The service factory attaches the depth-cue controller and its ticker exactly when the channel qualifies, and every channel it builds shares one listener cache. Channels that do not qualify get nothing: no component, no controller, no per-frame work.
UnityAudioPlayerServiceFactoryTests
Tests for UnityAudioPlayerServiceFactory.
Only the constructor / wiring is exercised here; the full CreateService path is
intentionally not driven because it spins up a UnityAudioPlayerService MonoBehaviour
and calls Initialize, which subscribes to events and touches the audio engine —
that needs scene/runtime fixtures out of scope for a pure unit test.
UnityAudioPlayerSettingsTests
Tests for the UnityAudioPlayerSettings ScriptableObject and its explicit IAudioPlayerSettings / IFoundationSettings implementations.
UnityAudioPlayerSourcePoolTests
The stateless bookkeeping over a service's pooled sources and their states: allocating states, finding the first free slot, listing replaceable candidates and stamping a started slot with the next sequence.
UnityAudioPlayerSourceStateTests
Tests for UnityAudioPlayerSourceState, the per-slot runtime metadata tracked alongside each pooled UnityEngine.AudioSource.
UnityAudioPortalComponentTests
Tests for how UnityAudioPortalComponent joins the nearest UnityAudioRoomComponent above it while it is open (enabled, on an active GameObject) and leaves it when it closes. Rooms use registries the tests own, never the shared one.
UnityAudioRoomAuthoringWarningTests
What a running Audio Room and Audio Portal tell the author: one warning for a room that contains nothing, one for a room with no portal, one for a portal with no room, each only once however often the component is enabled, through the log service when the game has one and the console otherwise. Runtime notices are warnings only; an error is shown in the inspector, never logged.
UnityAudioRoomComponentRegistrationTests
Tests for how UnityAudioRoomComponent joins and leaves a registry and lists its open portals. Rooms are built inactive, handed their own registry and then activated, so no test touches the shared registry.
UnityAudioRoomComponentShapeTests
Tests for the shape of a UnityAudioRoomComponent: the first enabled trigger collider that can tell where a point lies, resolved when the room is enabled and found again, at most once a frame, while the room has none or its shape is no longer usable. The geometry of each collider type is pinned by the containment util's own tests; these cover which collider the room chooses and when. Colliders are built in a hermetic corner of the physics world and synced before every question.
UnityAudioRoomRegistryTests
Tests for Serenity.AudioPlayer.Infrastructure.Services.UnityAudioRoomRegistry on plain fake rooms: registration, nesting, dead entries and the shared instance.
UnityPhysicsOcclusionProbeFallbackMemoryTests
Real-physics tests for the memory the fallback of Serenity.AudioPlayer.Infrastructure.Services.UnityPhysicsOcclusionProbe keeps per voice: a voice that holds still behind a collider whose bounds mislead costs one ray per tick instead of a full fallback, and any change of the listener, the source, the collider or the layers makes the next tick cast the fallback again.
UnityPhysicsOcclusionProbeFallbackTests
Real-physics tests for the multi-ray fallback of Serenity.AudioPlayer.Infrastructure.Services.UnityPhysicsOcclusionProbe: when the bounds of the blocking collider mislead (a mesh that is not convex, terrain, a large wall seen at a diagonal), three waypoint paths around the middle of the line are cast instead, and the share of them that is blocked sets the amount. Gates are small boxes placed exactly on a waypoint to block that path and no other.
UnityPhysicsOcclusionProbeGradedTests
Real-physics tests for the graded path of Serenity.AudioPlayer.Infrastructure.Services.UnityPhysicsOcclusionProbe: a wall away from both ends is graded by the detour around its bounds with one linecast, and a full detour length of zero or less keeps the all-or-nothing answer. The expected amounts follow the log curve at 12 m: a detour of x metres reads ln(1 + x / 1.2) / ln(11).
UnityPhysicsOcclusionProbeStaleBoundsTests
Tests for the report Serenity.AudioPlayer.Infrastructure.Services.UnityPhysicsOcclusionProbe makes when the engine says a collider blocks the line but its bounds do not even cross it seen from above: the bounds are out of date, which is worth one verbose message and no more.
UnityPhysicsOcclusionProbeTests
Real-physics tests for Serenity.AudioPlayer.Infrastructure.Services.UnityPhysicsOcclusionProbe: the listener-to-source linecast that decides whether a wall sits between them.