logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.Shared.Tests.Utils

    Classes

    AsyncMutexTests

    Tests for AsyncMutex: the guarantee the whole point of the type rests on — that a critical section spanning an await runs to completion before the next caller enters.

    CsvEscapingTests

    Tests for CsvEscaping: the RFC 4180 rules a hand-rolled CSV writer gets wrong, the whitespace rule RFC 4180 does not have and every reader needs, and the promise that a row carries no line ending of its own.

    DisplayValueTests

    FileUtilsTests

    LocalePreviewMatcherTests

    NamingSanitizerTests

    Pure tests for NamingSanitizer. AppendSuffixUnlessPresent(string, string) is the doubling guard behind two reported bugs: Theme Builder appending "Theme" to a name that already ends in it (ThemeCreator.ResolveThemeFolderName) and Service Extension Creator appending the extension point's own name/type name unconditionally (ServiceExtensionNaming.ComposeTypeName).

    NumberUtilsTests

    ObjectUtilsTests

    ObjectUtilsTests.TestAbstractImpl

    ObjectUtilsTests.TestBase

    ObjectUtilsTests.TestDerived1

    ObjectUtilsTests.TestDerived2

    ObjectUtilsTests.TestImpl1

    ObjectUtilsTests.TestImpl2

    ObjectUtilsTypeResolutionTests

    Tests for GetTypeFromCurrentDomainAssemblies(string).
    The lookup used to scan every assembly — materializing every type, twice — on each call that missed the Type.GetType fast path, which measured at seconds per call and froze the editor on every keystroke of a partial type name. It now answers from a lazily built index. These tests pin the resolution semantics the index must reproduce exactly; the speed itself was verified by measurement.

    OnceGuardTests

    Tests for OnceGuard and OnceGuard<TKey>: the warn-once latch behaviour every caller relies on — report the first time, stay quiet afterwards, and still report a different key.

    ParseUtilsTests

    ParseUtilsTypeTests

    ReentrancyGateTests

    Tests for ReentrancyGate: the "not while I am already running" gate, and the property that separates it from its OnceGuard sibling — it releases, so the guarded work is reachable again after it finishes.

    SafeCollectionUtilsTests

    SerenityTextElidingTests

    Tests for SerenityTextEliding. Pure string logic, so every case runs without an editor/player context.

    SignalCategoryFilteringTests

    Tests for SignalCategoryFiltering, extracted from Serenity.EventDispatcher.Infrastructure.Editor.SerenitySignalFlowBrowserWindow's search box and category chip row, which previously had no coverage at all.

    SingletonSettingsSelectionTests

    Tests for Pick<T>(IReadOnlyList<T>, Func<T, bool>, Func<T, string>, out SingletonSelectionOutcome): the ownership rule a project-owned settings asset beats a shipped one, applied to plain string candidates so the policy itself stays engine-agnostic.

    StringUtilsTests

    UniqueNameGeneratorTests

    ValueDisplayFormatterTests

    Tests for ValueDisplayFormatter. Pure formatting logic, so every case runs without an editor/player context.
    Rounding-boundary cases deliberately use values whose fractional part is exactly representable in binary (e.g. 0.5, 12.25, 12.125) rather than decimal-looking values like 0.995 -- those are NOT exact as doubles, so asserting a specific rounded result for them would be testing floating-point representation quirks instead of the formatter's rounding rule.

    Interfaces

    ObjectUtilsTests.ITestInterface

    In this article
    © 2026 Serenity. All Rights Reserved