Namespace Serenity.Tests.Shared
Classes
AsyncAssert
Truly awaitable exception assertions for async code under test.
FramePump
Frame-pumping waits for [UnityTest] coroutines, bounded by a wall-clock budget.
FramePumpTests
Guards the budget contract of FramePump.
PrivateMemberInvoker
Reflection helper for invoking non-public members under test. Lets a construction-only test
suite pin a type's private SQL-building internals directly (exact CommandText and
Parameters shape) without widening their visibility and without opening a real
connection.
RecordingEventDispatcherServiceTests
Guards RecordingEventDispatcherService against the race that flaked
BlobScreenshotUnlockFlowTests.Unlock_StoresTheFrameAndStampsItsKeyOnTheRecordAndTheSignal:
a fire-and-forget dispatch resuming on a thread-pool thread, mutating the same list the test
thread was enumerating.
ScratchAssetFixtureTests
EditMode tests for ScratchAssetFixture itself: it creates a real settings asset under a
scratch folder, tracks the GUID an Addressables entry was registered against, and its own
Dispose() removes both. The bounded retry inside
DeleteScratchFolders() is documented, not exercised here: the
.meta write-lock flake it absorbs needs a held file handle this suite has no way to inject.
UnitySerializedFieldAssertions
The assertion half of a "seed every field, force a rollback, assert it all comes back" test —
UnitySerializedFieldReflection enumerates the fields to walk, this compares what a restore
put back against what was captured. AssertRestored(string, object, object) dispatches on the VALUE's own shape
(a Unity object reference, a value type or string, a list, or a managed reference) rather than on the
declaring field's static type, so the same walk handles a captured scalar, a captured list, and a
captured element nested inside that list uniformly. A restored [SerializeReference] element comes
back as a fresh instance, so identity says nothing about it — its concrete type and every one of its own
serialized fields are what must match, which is why the managed-reference branch recurses field by field
instead of comparing the two instances directly. Previously duplicated byte-for-byte across
SerenityExistingAssetRestoreTests and several creators' own field-walk regression tests.
UnitySerializedFieldReflection
Reflection walk over a Unity-serialized type's fields — public or [SerializeField], never
[NonSerialized]. Backs every "seed every field, force a rollback, assert it all comes back" test
that proves a capture-restore mechanism is field-list-free rather than hand-maintained. Previously
duplicated byte-for-byte across SerenityExistingAssetRestoreTests, PlayerInputCreatorTests
and WaveCreatorTests.
UnitySerializedFieldSeeds
Seed-value helpers for a "seed every field, force a rollback, assert it all comes back" test — shared because the scalar/enum/Object-reference/LayerMask branches of that type switch were previously duplicated byte-for-byte across fifteen field-walk test suites. Each suite keeps only the parts that are genuinely its own: resolving which id or alternate reference a given field maps to, and building any nested composite type (a spawn entry, a sync-map row, a signal parameter…) the walked type embeds.