//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// UserRTX.NET satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;

#if !WASM
namespace user_rtx { using u = user_rtx;
#else
namespace user_rtx.wasm { using u = user_rtx.wasm;
#endif

/// <summary>
/// Argument checking errors (exception creation)
/// </summary>
public static partial class arg_check_errors {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public static string PN( string? paramName ) => paramName ?? "value";
//==================================================================================================

public static ArgumentException ARRAY_OF_NOT_NULL_VALUES_WAS_EXPECTED( string? paramName ) =>
   new ArgumentException(
      "Array of not null values was expected.",
      PN(paramName) );

//--------------------------------------------------------------------------------------------------

public static ArgumentOutOfRangeException NONZERO_VALUE_WAS_EXPECTED( string? paramName ) =>
   new ArgumentOutOfRangeException( PN(paramName),
      "Non-zero value was expected." );

public static ArgumentOutOfRangeException NONNEGATIVE_NUMBER_WAS_EXPECTED( string? paramName ) =>
   new ArgumentOutOfRangeException( PN(paramName),
      "Not negative number was expected." );
public static ArgumentOutOfRangeException POSITIVE_NUMBER_WAS_EXPECTED( string? paramName ) =>
   new ArgumentOutOfRangeException( PN(paramName),
      "Positive number was expected." );

public static ArgumentOutOfRangeException NOT_IN_RANGE( string? paramName,
                                                        object from, object to ) =>
   new ArgumentOutOfRangeException( PN(paramName),
      $"Value is not in restricting range: [{from}..{to}]." );

public static ArgumentOutOfRangeException NOT_GREATER_THAN_OR_EQUAL_TO( string? paramName,
                                                                        object lower ) =>
   new ArgumentOutOfRangeException( PN(paramName),
      $"Value must be greater than or equal to: {lower}." );
public static ArgumentOutOfRangeException NOT_GREATER_THAN( string? paramName, object xLower ) =>
   new ArgumentOutOfRangeException( PN(paramName),
      $"Value must be greater than: {xLower}." );

public static ArgumentOutOfRangeException NOT_LESS_THAN_OR_EQUAL_TO( string? paramName,
                                                                     object lower ) =>
   new ArgumentOutOfRangeException( PN(paramName),
      $"Value must be less than or equal to: {lower}." );
public static ArgumentOutOfRangeException NOT_LESS_THAN( string? paramName, object xUpper ) =>
   new ArgumentOutOfRangeException( PN(paramName),
      $"Value must be less than: {xUpper}." );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // arg_check_errors

} // user_rtx (.wasm)
