 | ByteExtensionsGetRandom Method (Byte, Byte) |
Returns a random number greater than or equal to the
specified minValue and less than the specified maxValue
Namespace:
TestHelperExtensions
Assembly:
CBI.TestHelperExtensions (in CBI.TestHelperExtensions.dll) Version: 2.1.0.1
Syntaxpublic static byte GetRandom(
this byte maxValue,
byte minValue
)
<ExtensionAttribute>
Public Shared Function GetRandom (
maxValue As Byte,
minValue As Byte
) As Byte
public:
[ExtensionAttribute]
static unsigned char GetRandom(
unsigned char maxValue,
unsigned char minValue
)
[<ExtensionAttribute>]
static member GetRandom :
maxValue : byte *
minValue : byte -> byte
Parameters
- maxValue
- Type: SystemByte
The non-inclusive maximum integer value for the random number - minValue
- Type: SystemByte
the inclusive minimum integer value for the random number
Return Value
Type:
ByteA random byte
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Byte. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Remarks255 is not a reachable value here since the maximum value
of a byte is 255 and the specified maxValue is non-inclusive.
See Also