diff --git a/Source/Bogus/Randomizer.cs b/Source/Bogus/Randomizer.cs index 73a96d74..de088ec6 100644 --- a/Source/Bogus/Randomizer.cs +++ b/Source/Bogus/Randomizer.cs @@ -173,8 +173,8 @@ public int Odd(int min = 0, int max = 1) /// /// Get a random double, between 0.0 and 1.0. /// - /// Minimum, default 0.0 - /// Maximum, default 1.0 + /// Minimum, inclusive. Default 0.0 + /// Maximum, exclusive. Default 1.0 public double Double(double min = 0.0d, double max = 1.0d) { //lock any seed access, for thread safety. @@ -193,8 +193,8 @@ public double Double(double min = 0.0d, double max = 1.0d) /// /// Get a random decimal, between 0.0 and 1.0. /// - /// Minimum, default 0.0 - /// Maximum, default 1.0 + /// Minimum, inclusive. Default 0.0 + /// Maximum, exclusive. Default 1.0 public decimal Decimal(decimal min = 0.0m, decimal max = 1.0m) { return Convert.ToDecimal(Double()) * (max - min) + min; @@ -203,8 +203,8 @@ public decimal Decimal(decimal min = 0.0m, decimal max = 1.0m) /// /// Get a random float, between 0.0 and 1.0. /// - /// Minimum, default 0.0 - /// Maximum, default 1.0 + /// Minimum, inclusive. Default 0.0 + /// Maximum, inclusive. Default 1.0 public float Float(float min = 0.0f, float max = 1.0f) { return Convert.ToSingle(Double() * (max - min) + min); @@ -213,8 +213,8 @@ public float Float(float min = 0.0f, float max = 1.0f) /// /// Generate a random byte between 0 and 255. /// - /// Min value, default byte.MinValue 0 - /// Max value, default byte.MaxValue 255 + /// Min value, inclusive. Default byte.MinValue 0 + /// Max value, inclusive. Default byte.MaxValue 255 public byte Byte(byte min = byte.MinValue, byte max = byte.MaxValue) { return Convert.ToByte(Number(min, max)); @@ -237,8 +237,8 @@ public byte[] Bytes(int count) /// /// Generate a random sbyte between -128 and 127. /// - /// Min value, default sbyte.MinValue -128 - /// Max value, default sbyte.MaxValue 127 + /// Min value, inclusive. Default sbyte.MinValue -128 + /// Max value, inclusive. Default sbyte.MaxValue 127 public sbyte SByte(sbyte min = sbyte.MinValue, sbyte max = sbyte.MaxValue) { return Convert.ToSByte(Number(min, max)); @@ -247,8 +247,8 @@ public sbyte SByte(sbyte min = sbyte.MinValue, sbyte max = sbyte.MaxValue) /// /// Generate a random int between MinValue and MaxValue. /// - /// Min value, default int.MinValue - /// Max value, default int.MaxValue + /// Min value, inclusive. Default int.MinValue + /// Max value, inclusive. Default int.MaxValue public int Int(int min = int.MinValue, int max = int.MaxValue) { return this.Number(min, max); @@ -257,8 +257,8 @@ public int Int(int min = int.MinValue, int max = int.MaxValue) /// /// Generate a random uint between MinValue and MaxValue. /// - /// Min value, default uint.MinValue - /// Max value, default uint.MaxValue + /// Min value, inclusive. Default uint.MinValue + /// Max value, inclusive. Default uint.MaxValue public uint UInt(uint min = uint.MinValue, uint max = uint.MaxValue) { return Convert.ToUInt32(Double() * (max - min) + min); @@ -267,8 +267,8 @@ public uint UInt(uint min = uint.MinValue, uint max = uint.MaxValue) /// /// Generate a random ulong between MinValue and MaxValue. /// - /// Min value, default ulong.MinValue - /// Max value, default ulong.MaxValue + /// Min value, inclusive. Default ulong.MinValue + /// Max value, inclusive. Default ulong.MaxValue public ulong ULong(ulong min = ulong.MinValue, ulong max = ulong.MaxValue) { return Convert.ToUInt64(Double() * (max - min) + min); @@ -277,8 +277,8 @@ public ulong ULong(ulong min = ulong.MinValue, ulong max = ulong.MaxValue) /// /// Generate a random long between MinValue and MaxValue. /// - /// Min value, default long.MinValue - /// Max value, default long.MaxValue + /// Min value, inclusive. Default long.MinValue + /// Max value, inclusive. Default long.MaxValue public long Long(long min = long.MinValue, long max = long.MaxValue) { var range = (decimal)max - min; //use more bits? @@ -288,8 +288,8 @@ public long Long(long min = long.MinValue, long max = long.MaxValue) /// /// Generate a random short between MinValue and MaxValue. /// - /// Min value, default short.MinValue -32768 - /// Max value, default short.MaxValue 32767 + /// Min value, inclusive. Default short.MinValue -32768 + /// Max value, inclusive. Default short.MaxValue 32767 public short Short(short min = short.MinValue, short max = short.MaxValue) { return Convert.ToInt16(Double() * (max - min) + min); @@ -298,8 +298,8 @@ public short Short(short min = short.MinValue, short max = short.MaxValue) /// /// Generate a random ushort between MinValue and MaxValue. /// - /// Min value, default ushort.MinValue 0 - /// Max value, default ushort.MaxValue 65535 + /// Min value, inclusive. Default ushort.MinValue 0 + /// Max value, inclusive. Default ushort.MaxValue 65535 public ushort UShort(ushort min = ushort.MinValue, ushort max = ushort.MaxValue) { return Convert.ToUInt16(Double() * (max - min) + min); @@ -308,8 +308,8 @@ public ushort UShort(ushort min = ushort.MinValue, ushort max = ushort.MaxValue) /// /// Generate a random char between MinValue and MaxValue. /// - /// Min value, default char.MinValue - /// Max value, default char.MaxValue + /// Min value, inclusive. Default char.MinValue + /// Max value, inclusive. Default char.MaxValue public char Char(char min = char.MinValue, char max = char.MaxValue) { return Convert.ToChar(Number(min, max)); @@ -318,8 +318,8 @@ public char Char(char min = char.MinValue, char max = char.MaxValue) /// /// Generate a random chars between MinValue and MaxValue. /// - /// Min value, default char.MinValue - /// Max value, default char.MaxValue + /// Min value, inclusive. Default char.MinValue + /// Max value, inclusive. Default char.MaxValue /// The length of chars to return public char[] Chars(char min = char.MinValue, char max = char.MaxValue, int count = 5) { @@ -336,8 +336,8 @@ public char[] Chars(char min = char.MinValue, char max = char.MaxValue, int coun /// Use for technically valid Unicode. /// /// The exact length of the result string. If null, a random length is chosen between 40 and 80. - /// Min character value, default char.MinValue - /// Max character value, default char.MaxValue + /// Min character value, inclusive. Default char.MinValue + /// Max character value, inclusive. Default char.MaxValue public string String(int? length = null, char minChar = char.MinValue, char maxChar = char.MaxValue) { var l = length ?? this.Number(40, 80); @@ -353,8 +353,8 @@ public string String(int? length = null, char minChar = char.MinValue, char maxC /// /// Lower-bound string length. Inclusive. /// Upper-bound string length. Inclusive. - /// Min character value, default char.MinValue - /// Max character value, default char.MaxValue + /// Min character value, inclusive. Default char.MinValue + /// Max character value, inclusive. Default char.MaxValue public string String(int minLength, int maxLength, char minChar = char.MinValue, char maxChar = char.MaxValue) { var length = this.Number(minLength, maxLength); @@ -384,8 +384,8 @@ public string String2(int length, string chars = "abcdefghijklmnopqrstuvwxyz") /// Get a string of characters with a specific length drawing characters from . /// The returned string may contain repeating characters from the string. /// - /// The minimum length of the string to return. - /// The maximum length of the string to return. + /// The minimum length of the string to return, inclusive. + /// The maximum length of the string to return, inclusive. /// The pool of characters to draw from. The returned string may contain repeat characters from the pool. public string String2(int minLength, int maxLength, string chars = "abcdefghijklmnopqrstuvwxyz") { @@ -397,8 +397,8 @@ public string String2(int minLength, int maxLength, string chars = "abcdefghijkl /// Get a string of valid UTF16 Unicode characters. /// This method returns a string where each character IsLetterOrDigit() is true. /// - /// The minimum length of the string to return. - /// The maximum length of the string to return. + /// The minimum length of the string to return, inclusive. + /// The maximum length of the string to return, inclusive. /// Excludes surrogate pairs from the returned string. public string Utf16String(int minLength = 40, int maxLength = 80, bool excludeSurrogates = false) { @@ -759,8 +759,8 @@ public string Words(int? count = null) /// /// Get a range of words in an array (English). /// - /// Minimum word count. - /// Maximum word count. + /// Minimum word count, inclusive. + /// Maximum word count, inclusive. public string[] WordsArray(int min, int max) { var count = Number(min, max);