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