Freigeben über


PexChoose.ThrowMaybe Method

Definition

Overloads

ThrowMaybe(String, PexChooseExceptionFactory[])

Allows IntelliTest to throw one of the exceptions provided by a list of exception factories.

ThrowMaybe(String, Type[])

Allows IntelliTest to throw an exception from a list of exception types.

ThrowMaybe<TException>(String)

Allows IntelliTest to throw an exception of a specified type.

ThrowMaybe(String, PexChooseExceptionFactory[])

Allows IntelliTest to throw one of the exceptions provided by a list of exception factories.

public:
 static void ThrowMaybe(System::String ^ name, ... cli::array <Microsoft::Pex::Framework::PexChooseExceptionFactory ^> ^ exceptionFactories);
public static void ThrowMaybe (string name, params Microsoft.Pex.Framework.PexChooseExceptionFactory[] exceptionFactories);
static member ThrowMaybe : string * Microsoft.Pex.Framework.PexChooseExceptionFactory[] -> unit
Public Shared Sub ThrowMaybe (name As String, ParamArray exceptionFactories As PexChooseExceptionFactory())

Parameters

name
String

The exception's name.

exceptionFactories
PexChooseExceptionFactory[]

One or more user-implemented exception factory delegates.

Applies to

ThrowMaybe(String, Type[])

Allows IntelliTest to throw an exception from a list of exception types.

public:
 static void ThrowMaybe(System::String ^ name, ... cli::array <Type ^> ^ exceptionTypes);
public static void ThrowMaybe (string name, params Type[] exceptionTypes);
static member ThrowMaybe : string * Type[] -> unit
Public Shared Sub ThrowMaybe (name As String, ParamArray exceptionTypes As Type())

Parameters

name
String

The exception's name.

exceptionTypes
Type[]

One or more exception types.

Remarks

The types in exceptionTypes must have public default constructors.

Applies to

ThrowMaybe<TException>(String)

Allows IntelliTest to throw an exception of a specified type.

public:
generic <typename TException>
 where TException : Exception static void ThrowMaybe(System::String ^ name);
public static void ThrowMaybe<TException> (string name) where TException : Exception;
static member ThrowMaybe : string -> unit (requires 'Exception :> Exception)
Public Shared Sub ThrowMaybe(Of TException As Exception) (name As String)

Type Parameters

TException

The exception type.

Parameters

name
String

The exception's name.

Remarks

TException must have a public default constructor.

Applies to