Assert.Catch Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Catch(Type, TestDelegate, String, Object[])
public static Exception Catch (Type expectedExceptionType, NUnit.Framework.TestDelegate code, string message, params object[] args);
static member Catch : Type * NUnit.Framework.TestDelegate * string * obj[] -> Exception
Parameters
- expectedExceptionType
- Type
- code
- TestDelegate
- message
- String
- args
- Object[]
Returns
Applies to
Catch(TestDelegate)
public static Exception Catch (NUnit.Framework.TestDelegate code);
static member Catch : NUnit.Framework.TestDelegate -> Exception
Parameters
- code
- TestDelegate
Returns
Applies to
Catch(TestDelegate, String)
public static Exception Catch (NUnit.Framework.TestDelegate code, string message);
static member Catch : NUnit.Framework.TestDelegate * string -> Exception
Parameters
- code
- TestDelegate
- message
- String
Returns
Applies to
Catch(Type, TestDelegate)
public static Exception Catch (Type expectedExceptionType, NUnit.Framework.TestDelegate code);
static member Catch : Type * NUnit.Framework.TestDelegate -> Exception
Parameters
- expectedExceptionType
- Type
- code
- TestDelegate
Returns
Applies to
Catch(TestDelegate, String, Object[])
public static Exception Catch (NUnit.Framework.TestDelegate code, string message, params object[] args);
static member Catch : NUnit.Framework.TestDelegate * string * obj[] -> Exception
Parameters
- code
- TestDelegate
- message
- String
- args
- Object[]
Returns
Applies to
Catch(Type, TestDelegate, String)
public static Exception Catch (Type expectedExceptionType, NUnit.Framework.TestDelegate code, string message);
static member Catch : Type * NUnit.Framework.TestDelegate * string -> Exception
Parameters
- expectedExceptionType
- Type
- code
- TestDelegate
- message
- String
Returns
Applies to
Catch<T>(TestDelegate, String)
public static T Catch<T> (NUnit.Framework.TestDelegate code, string message) where T : Exception;
static member Catch : NUnit.Framework.TestDelegate * string -> 'T (requires 'T :> Exception)
Type Parameters
- T
Parameters
- code
- TestDelegate
- message
- String
Returns
T
Applies to
Catch<T>(TestDelegate, String, Object[])
public static T Catch<T> (NUnit.Framework.TestDelegate code, string message, params object[] args) where T : Exception;
static member Catch : NUnit.Framework.TestDelegate * string * obj[] -> 'T (requires 'T :> Exception)
Type Parameters
- T
Parameters
- code
- TestDelegate
- message
- String
- args
- Object[]
Returns
T
Applies to
Catch<T>(TestDelegate)
public static T Catch<T> (NUnit.Framework.TestDelegate code) where T : Exception;
static member Catch : NUnit.Framework.TestDelegate -> 'T (requires 'T :> Exception)
Type Parameters
- T
Parameters
- code
- TestDelegate
Returns
T