ExceptionAssertThrowsTException Method (Action, String, Boolean) |
Checks if the exception of type TException was thrown.
Namespace:
Enkoni.Framework.Testing
Assembly:
Enkoni.Framework.Testing (in Enkoni.Framework.Testing.dll) Version: 1.3.0.1
Syntaxpublic static void Throws<TException>(
Action action,
string message,
bool allowDerivedTypes
)
where TException : Exception
Public Shared Sub Throws(Of TException As Exception) (
action As Action,
message As String,
allowDerivedTypes As Boolean
)
public:
generic<typename TException>
where TException : Exception
static void Throws(
Action^ action,
String^ message,
bool allowDerivedTypes
)
static member Throws :
action : Action *
message : string *
allowDerivedTypes : bool -> unit when 'TException : Exception
Parameters
- action
- Type: SystemAction
The action that should throw an exception of type TException. - message
- Type: SystemString
The message that should be used when no exception was thrown. - allowDerivedTypes
- Type: SystemBoolean
Specifies whether derived types of the exception are allowed.
Type Parameters
- TException
- The type of the exception that should be thrown.
ExceptionsException | Condition |
---|
Exception | An exception that does not inherit from TException |
See Also