TestContext.CurrentTestOutcome 屬性

您可以在 TestCleanup 方法使用這個屬性,以判斷已執行之測試的結果。

命名空間:  Microsoft.VisualStudio.TestTools.UnitTesting
組件:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (在 Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll 中)

語法

'宣告
Public Overridable ReadOnly Property CurrentTestOutcome As UnitTestOutcome
    Get
public virtual UnitTestOutcome CurrentTestOutcome { get; }
public:
virtual property UnitTestOutcome CurrentTestOutcome {
    UnitTestOutcome get ();
}
abstract CurrentTestOutcome : UnitTestOutcome
override CurrentTestOutcome : UnitTestOutcome
function get CurrentTestOutcome () : UnitTestOutcome

屬性值

型別:Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome
UnitTestOutcome ,表示已執行之測試的結果。

.NET Framework 安全性

請參閱

參考

TestContext 類別

Microsoft.VisualStudio.TestTools.UnitTesting 命名空間