Search Results for

    Show / Hide Table of Contents

    Class RandomAttribute

    Supplies a set of random values to a single parameter of a parameterized test.

    Inheritance
    object
    Attribute
    NUnitAttribute
    RandomAttribute
    Implements
    IParameterDataSource
    Inherited Members
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.Equals(object)
    Attribute.GetHashCode()
    Attribute.Match(object)
    Attribute.IsDefaultAttribute()
    Attribute.TypeId
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    Namespace: NUnit.Framework
    Assembly: nunit.framework.dll
    Syntax
    [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
    public class RandomAttribute : NUnitAttribute, IParameterDataSource

    Constructors

    View Source

    RandomAttribute(byte, byte, int)

    Generates byte values within a specified range.

    Declaration
    public RandomAttribute(byte min, byte max, int count)
    Parameters
    Type Name Description
    byte min
    byte max
    int count
    View Source

    RandomAttribute(double, double, int)

    Generates double values within a specified range.

    Declaration
    public RandomAttribute(double min, double max, int count)
    Parameters
    Type Name Description
    double min
    double max
    int count
    View Source

    RandomAttribute(short, short, int)

    Generates short values within a specified range.

    Declaration
    public RandomAttribute(short min, short max, int count)
    Parameters
    Type Name Description
    short min
    short max
    int count
    View Source

    RandomAttribute(int)

    Construct a random set of values appropriate for the Type of the parameter on which the attribute appears, specifying only the count.

    Declaration
    public RandomAttribute(int count)
    Parameters
    Type Name Description
    int count
    View Source

    RandomAttribute(int, int, int)

    Generates int values within a specified range.

    Declaration
    public RandomAttribute(int min, int max, int count)
    Parameters
    Type Name Description
    int min
    int max
    int count
    View Source

    RandomAttribute(long, long, int)

    Generates long values within a specified range.

    Declaration
    public RandomAttribute(long min, long max, int count)
    Parameters
    Type Name Description
    long min
    long max
    int count
    View Source

    RandomAttribute(sbyte, sbyte, int)

    Generates sbyte values within a specified range.

    Declaration
    [CLSCompliant(false)]
    public RandomAttribute(sbyte min, sbyte max, int count)
    Parameters
    Type Name Description
    sbyte min
    sbyte max
    int count
    View Source

    RandomAttribute(float, float, int)

    Generates float values within a specified range.

    Declaration
    public RandomAttribute(float min, float max, int count)
    Parameters
    Type Name Description
    float min
    float max
    int count
    View Source

    RandomAttribute(ushort, ushort, int)

    Generates ushort values within a specified range.

    Declaration
    [CLSCompliant(false)]
    public RandomAttribute(ushort min, ushort max, int count)
    Parameters
    Type Name Description
    ushort min
    ushort max
    int count
    View Source

    RandomAttribute(uint, uint, int)

    Generates uint values within a specified range.

    Declaration
    [CLSCompliant(false)]
    public RandomAttribute(uint min, uint max, int count)
    Parameters
    Type Name Description
    uint min
    uint max
    int count
    View Source

    RandomAttribute(ulong, ulong, int)

    Generates ulong values within a specified range.

    Declaration
    [CLSCompliant(false)]
    public RandomAttribute(ulong min, ulong max, int count)
    Parameters
    Type Name Description
    ulong min
    ulong max
    int count

    Properties

    View Source

    Distinct

    If true, no value will be repeated.

    Declaration
    public bool Distinct { get; set; }
    Property Value
    Type Description
    bool

    Methods

    View Source

    GetData(IParameterInfo)

    Retrieves a list of arguments which can be passed to the specified parameter.

    Declaration
    public IEnumerable GetData(IParameterInfo parameter)
    Parameters
    Type Name Description
    IParameterInfo parameter

    The parameter of a parameterized test.

    Returns
    Type Description
    IEnumerable

    Implements

    IParameterDataSource
    • View Source
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0