Show / Hide Table of Contents

Class Randomizer

Provides a set of methods for data randomization.

Inheritance
System.Object
Randomizer
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Relativity.Testing.Framework
Assembly: Relativity.Testing.Framework.dll
Syntax
public static class Randomizer

Fields

| Improve this Doc View Source

DefaultEmailAddressLength

The default random email address length.

Declaration
public const int DefaultEmailAddressLength = 35
Field Value
Type Description
System.Int32
| Improve this Doc View Source

DefaultStringLength

The default random string length.

Declaration
public const int DefaultStringLength = 24
Field Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

GetEmailAddress(Int32)

Gets the random email address.

Declaration
public static string GetEmailAddress(int length = 35)
Parameters
Type Name Description
System.Int32 length

The length.

Returns
Type Description
System.String

The random email address string.

Exceptions
Type Condition
System.ArgumentException

The length should be positive. Or the length of string is not greater than the format length.

| Improve this Doc View Source

GetInt(Int32)

Returns a non-negative random integer that is less than the specified maximum.

Declaration
public static int GetInt(int max)
Parameters
Type Name Description
System.Int32 max

The exclusive upper bound of the random number to be generated. Must be greater than or equal to 0.

Returns
Type Description
System.Int32

The random System.Int32 value.

| Improve this Doc View Source

GetInt(Int32, Int32)

Returns a random integer that is within a specified range.

Declaration
public static int GetInt(int min, int max)
Parameters
Type Name Description
System.Int32 min

The inclusive lower bound of the random number returned.

System.Int32 max

The inclusive upper bound of the random number returned. Must be greater than or equal to min.

Returns
Type Description
System.Int32

The random System.Int32 value.

| Improve this Doc View Source

GetPassword()

Gets a randomly generated password according to secure requirements.

Declaration
public static string GetPassword()
Returns
Type Description
System.String

The random password.

| Improve this Doc View Source

GetString(String, Int32)

Gets the random string.

Declaration
public static string GetString(string format = "{0}", int length = 24)
Parameters
Type Name Description
System.String format

The format, that can contain {0} for random value insertion.

System.Int32 length

The length.

Returns
Type Description
System.String

The random string.

Exceptions
Type Condition
System.ArgumentException

The length should be positive. Or the length of string is not greater than the format length.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX