logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class 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.

    Inheritance
    object
    ValueDisplayFormatterTests
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Shared.Tests.Utils
    Assembly: Tests.dll
    Syntax
    public class ValueDisplayFormatterTests

    Constructors

    ValueDisplayFormatterTests()

    Declaration
    public ValueDisplayFormatterTests()

    Methods

    Format_Decimal_CollapsesNegativeZero(double, int, string)

    Declaration
    public void Format_Decimal_CollapsesNegativeZero(double value, int decimalPlaces, string expected)
    Parameters
    Type Name Description
    double value
    int decimalPlaces
    string expected

    Format_Decimal_ProducesExpectedText(double, int, string)

    Declaration
    public void Format_Decimal_ProducesExpectedText(double value, int decimalPlaces, string expected)
    Parameters
    Type Name Description
    double value
    int decimalPlaces
    string expected

    Format_Decimal_WithZeroPlaces_RendersWholeNumber()

    Declaration
    public void Format_Decimal_WithZeroPlaces_RendersWholeNumber()

    Format_Integer_CollapsesNegativeZero(double)

    Declaration
    public void Format_Integer_CollapsesNegativeZero(double value)
    Parameters
    Type Name Description
    double value

    Format_Integer_ProducesExpectedText(double, string)

    Declaration
    public void Format_Integer_ProducesExpectedText(double value, string expected)
    Parameters
    Type Name Description
    double value
    string expected

    Format_WithMinimumIntegerDigits_PadsIntegerPartOnly()

    Declaration
    public void Format_WithMinimumIntegerDigits_PadsIntegerPartOnly()

    Format_WithMinimumIntegerDigits_ZeroPads(double, int, string)

    Declaration
    public void Format_WithMinimumIntegerDigits_ZeroPads(double value, int minimumDigits, string expected)
    Parameters
    Type Name Description
    double value
    int minimumDigits
    string expected

    Format_WithThousandsSeparatorAndPadding_AppliesBoth()

    Declaration
    public void Format_WithThousandsSeparatorAndPadding_AppliesBoth()

    Format_WithThousandsSeparator_GroupsIntegerPart(double, string)

    Declaration
    public void Format_WithThousandsSeparator_GroupsIntegerPart(double value, string expected)
    Parameters
    Type Name Description
    double value
    string expected

    Spec_ClampsMinimumIntegerDigitsToAtLeastOne()

    Declaration
    public void Spec_ClampsMinimumIntegerDigitsToAtLeastOne()

    Spec_ClampsNegativeDecimalPlacesToZero()

    Declaration
    public void Spec_ClampsNegativeDecimalPlacesToZero()

    Spec_EqualityComparesEveryKnob()

    Declaration
    public void Spec_EqualityComparesEveryKnob()

    Spec_IsTimeFormat_OnlyForTheStopwatch()

    Declaration
    public void Spec_IsTimeFormat_OnlyForTheStopwatch()

    Stopwatch_AutoHours_AppearOnlyOnceTheDurationReachesOne()

    Declaration
    public void Stopwatch_AutoHours_AppearOnlyOnceTheDurationReachesOne()

    Stopwatch_ComposesTheArcadeStyleFromOptionsRatherThanANamedFormat()

    Declaration
    public void Stopwatch_ComposesTheArcadeStyleFromOptionsRatherThanANamedFormat()

    Stopwatch_DecimalPlaces_AreConfigurable(int, string)

    Declaration
    public void Stopwatch_DecimalPlaces_AreConfigurable(int decimals, string expected)
    Parameters
    Type Name Description
    int decimals
    string expected

    Stopwatch_HoursMinutesAndSeconds_ProducesExpectedText(double, string)

    Declaration
    public void Stopwatch_HoursMinutesAndSeconds_ProducesExpectedText(double value, string expected)
    Parameters
    Type Name Description
    double value
    string expected

    Stopwatch_MinuteDigitsControlPadding()

    Declaration
    public void Stopwatch_MinuteDigitsControlPadding()

    Stopwatch_MinutesAndSeconds_ProducesExpectedText(double, string)

    Declaration
    public void Stopwatch_MinutesAndSeconds_ProducesExpectedText(double value, string expected)
    Parameters
    Type Name Description
    double value
    string expected

    Stopwatch_NeverHours_LetsMinutesRunPastSixty()

    Declaration
    public void Stopwatch_NeverHours_LetsMinutesRunPastSixty()

    Stopwatch_RoundsOnceSoThePartsNeverDisagree()

    Declaration
    public void Stopwatch_RoundsOnceSoThePartsNeverDisagree()
    In this article
    © 2026 Serenity. All Rights Reserved