Share via


ReactiveAssert.Throws<TException> Method (Action, String)

Asserts that the given action throws an exception of the type specified in the generic parameter.

Namespace:  Microsoft.Reactive.Testing
Assembly:  Microsoft.Reactive.Testing (in Microsoft.Reactive.Testing.dll)

Syntax

'Declaration
Public Shared Sub Throws(Of TException As Exception) ( _
    action As Action, _
    message As String _
)
'Usage
Dim action As Action
Dim message As String

ReactiveAssert.Throws(action, message)
public static void Throws<TException>(
    Action action,
    string message
)
where TException : Exception
public:
generic<typename TException>
where TException : Exception
static void Throws(
    Action^ action, 
    String^ message
)
static member Throws : 
        action:Action * 
        message:string -> unit  when 'TException : Exception
JScript does not support generic types and methods.

Type Parameters

  • TException
    The type of the exception to check for.

Parameters

  • message
    Type: System.String
    The error message for assert failure.

See Also

Reference

ReactiveAssert Class

Throws Overload

Microsoft.Reactive.Testing Namespace