TestAttribute 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將這個屬性新增至類別內 的方法,讓方法可從 NUnit 測試執行器呼叫。 有一個名為 Description 的屬性,這是選擇性屬性,您可以提供更詳細的測試描述。 此類別無法獲得繼承。
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class TestAttribute : NUnit.Framework.NUnitAttribute, NUnit.Framework.Internal.IApplyToTest
type TestAttribute = class
inherit NUnitAttribute
interface IApplyToTest
- 繼承
- 屬性
- 實作
範例
[TestFixture] public class Device { [Test] public void MethodToTest () {} [Test (Description = 「more detailed description」) ] publc void TestDescriptionMethod () {} }
建構函式
| TestAttribute() |
將這個屬性新增至類別內 的方法,讓方法可從 NUnit 測試執行器呼叫。 有一個名為 Description 的屬性,這是選擇性屬性,您可以提供更詳細的測試描述。 此類別無法獲得繼承。 |
屬性
| Description |
此測試的描述性文字 |
方法
| ApplyToTest(Test) |
將這個屬性新增至類別內 的方法,讓方法可從 NUnit 測試執行器呼叫。 有一個名為 Description 的屬性,這是選擇性屬性,您可以提供更詳細的測試描述。 此類別無法獲得繼承。 |