src/Kingdom.OrTools.Sat.Parameters.Tests/Cases/TestCaseDescriptor.cs
/// <summary>
/// Returns the Rendered <paramref name="value"/> in a predictable manner.
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
Returns the Rendered  in a predictable manner.
Returns the Rendered in a predictable manner .
internal static string RenderValue(object value)
        {
            switch (value)
            {
                case bool _:
                    return $"{value}".ToLower();
                case int _:
                case long _:
                    return $"{value}";
                case double doubleValue:
                    string RenderBaseDouble() => $"{doubleValue}";
                    if (IsNaN(doubleValue) || IsPositiveInfinity(doubleValue))
                    {
                        return RenderBaseDouble().Substring(0, 3).ToLower();
                    }
                    else if (IsNegativeInfinity(doubleValue))
                    {
                        return RenderBaseDouble().Substring(0, 4).ToLower();
                    }
                    return $"{value:R}";
                case Month monthValue:
                    return RenderMonthValue(monthValue);
                case AnnotatedWeekday weekdayValue:
                    return RenderWeekdayValue(weekdayValue);
                case null:
                    return null;
                default:
                    throw new InvalidOperationException($"Value type `{value.GetType().FullName}´ is unsupported.");
            }
        }
internal static string RenderValue ( object value ) { switch ( value ) { case bool _ : return $" { value } " . ToLower ( ) ; case int _ : case long _ : return $" { value } " ; case double doubleValue : string RenderBaseDouble ( ) => $" { doubleValue } " ; if ( IsNaN ( doubleValue ) || IsPositiveInfinity ( doubleValue ) ) { return RenderBaseDouble ( ) . Substring ( 0 , 3 ) . ToLower ( ) ; } else if ( IsNegativeInfinity ( doubleValue ) ) { return RenderBaseDouble ( ) . Substring ( 0 , 4 ) . ToLower ( ) ; } return $" { value : } " ; case Month monthValue : return RenderMonthValue ( monthValue ) ; case AnnotatedWeekday weekdayValue : return RenderWeekdayValue ( weekdayValue ) ; case null : return null ; default : throw new InvalidOperationException ( $" Value type ` { value . GetType ( ) . FullName } ´ is unsupported." ) ; } }
Returns the Rendered  in a predictable manner.
Returns the Rendered in a predictable manner .
// Same in either case. // Including Signage.
None
value
object
None