/// <summary> /// Creates an anonymous <see langword="char"/> value within the specified range using a uniform /// distribution algorithm. /// </summary> /// <param name="anon">The anonymous data provider to use.</param> /// <param name="minimum">The minimum value.</param> /// <param name="maximum">The maximum value.</param> /// <returns>A random <see langword="char"/> value.</returns> /// <exception cref="ArgumentNullException"><paramref name="anon"/> is <c>null</c>.</exception> public static char AnyChar(this IAnonymousData anon, char minimum, char maximum) { Argument.NotNull(anon, nameof(anon)); Argument.InRange(maximum, minimum, double.MaxValue, nameof(maximum), "The maximum value must be greater than the minimum value."); return(anon.AnyChar(minimum, maximum, Distribution.Uniform)); }
/// <summary> /// Creates an anonymous <see langword="char"/> value within the range of basic Latin characters using /// the specified distribution algorithm. /// </summary> /// <param name="anon">The anonymous data provider to use.</param> /// <param name="distribution">The distribution algorithm to use.</param> /// <returns>A random basic Latin character.</returns> /// <exception cref="ArgumentNullException"><paramref name="anon"/> is <c>null</c>.</exception> public static char AnyBasicLatinChar(this IAnonymousData anon, Distribution distribution) { Argument.NotNull(anon, nameof(anon)); return(anon.AnyChar((char)BasicLatinCharRange.Minimum, (char)BasicLatinCharRange.Maximum, distribution)); }
/// <summary> /// Creates an anonymous <see langword="char"/> value using the specified distribution algorithm. /// </summary> /// <param name="anon">The anonymous data provider to use.</param> /// <param name="distribution">The distribution algorithm to use.</param> /// <returns>A random <see langword="char"/> value.</returns> /// <exception cref="ArgumentNullException"><paramref name="anon"/> is <c>null</c>.</exception> public static char AnyChar(this IAnonymousData anon, Distribution distribution) { Argument.NotNull(anon, nameof(anon)); return(anon.AnyChar(char.MinValue, char.MaxValue, distribution)); }