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
ValueDisplayFormatterTests
Assembly: Tests.dll
public class ValueDisplayFormatterTests
Constructors
Declaration
public ValueDisplayFormatterTests()
Methods
Declaration
public void Format_Decimal_CollapsesNegativeZero(double value, int decimalPlaces, string expected)
Parameters
Format_Decimal_ProducesExpectedText(double, int, string)
Declaration
public void Format_Decimal_ProducesExpectedText(double value, int decimalPlaces, string expected)
Parameters
Declaration
public void Format_Decimal_WithZeroPlaces_RendersWholeNumber()
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
Declaration
public void Format_WithMinimumIntegerDigits_PadsIntegerPartOnly()
Declaration
public void Format_WithMinimumIntegerDigits_ZeroPads(double value, int minimumDigits, string expected)
Parameters
Declaration
public void Format_WithThousandsSeparatorAndPadding_AppliesBoth()
Declaration
public void Format_WithThousandsSeparator_GroupsIntegerPart(double value, string expected)
Parameters
Declaration
public void Spec_ClampsMinimumIntegerDigitsToAtLeastOne()
Declaration
public void Spec_ClampsNegativeDecimalPlacesToZero()
Declaration
public void Spec_EqualityComparesEveryKnob()
Declaration
public void Spec_IsTimeFormat_OnlyForTheStopwatch()
Declaration
public void Stopwatch_AutoHours_AppearOnlyOnceTheDurationReachesOne()
Declaration
public void Stopwatch_ComposesTheArcadeStyleFromOptionsRatherThanANamedFormat()
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
Declaration
public void Stopwatch_MinuteDigitsControlPadding()
Stopwatch_MinutesAndSeconds_ProducesExpectedText(double, string)
Declaration
public void Stopwatch_MinutesAndSeconds_ProducesExpectedText(double value, string expected)
Parameters
Declaration
public void Stopwatch_NeverHours_LetsMinutesRunPastSixty()
Declaration
public void Stopwatch_RoundsOnceSoThePartsNeverDisagree()