Assert.Catch 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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
参数
- expectedExceptionType
- Type
- code
- TestDelegate
- message
- String
- args
- Object[]
返回
适用于
Catch(TestDelegate)
public static Exception Catch (NUnit.Framework.TestDelegate code);
static member Catch : NUnit.Framework.TestDelegate -> Exception
参数
- code
- TestDelegate
返回
适用于
Catch(TestDelegate, String)
public static Exception Catch (NUnit.Framework.TestDelegate code, string message);
static member Catch : NUnit.Framework.TestDelegate * string -> Exception
参数
- code
- TestDelegate
- message
- String
返回
适用于
Catch(Type, TestDelegate)
public static Exception Catch (Type expectedExceptionType, NUnit.Framework.TestDelegate code);
static member Catch : Type * NUnit.Framework.TestDelegate -> Exception
参数
- expectedExceptionType
- Type
- code
- TestDelegate
返回
适用于
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
参数
- code
- TestDelegate
- message
- String
- args
- Object[]
返回
适用于
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
参数
- expectedExceptionType
- Type
- code
- TestDelegate
- message
- String
返回
适用于
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)
类型参数
- T
参数
- code
- TestDelegate
- message
- String
返回
T
适用于
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)
类型参数
- T
参数
- code
- TestDelegate
- message
- String
- args
- Object[]
返回
T
适用于
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)
类型参数
- T
参数
- code
- TestDelegate
返回
T