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