ITestExecutionPlugin.BeforeTestStarted 方法
在測試開始之前會呼叫這個方法。
命名空間: Microsoft.VisualStudio.TestTools.Execution
組件: Microsoft.VisualStudio.QualityTools.ExecutionCommon (在 Microsoft.VisualStudio.QualityTools.ExecutionCommon.dll 中)
語法
'宣告
Function BeforeTestStarted ( _
runContext As IDataCollectionRunContext, _
id As TestExecId _
) As Boolean
bool BeforeTestStarted(
IDataCollectionRunContext runContext,
TestExecId id
)
bool BeforeTestStarted(
IDataCollectionRunContext^ runContext,
TestExecId^ id
)
abstract BeforeTestStarted :
runContext:IDataCollectionRunContext *
id:TestExecId -> bool
function BeforeTestStarted(
runContext : IDataCollectionRunContext,
id : TestExecId
) : boolean
參數
- runContext
型別:Microsoft.VisualStudio.TestTools.Execution.IDataCollectionRunContext
表示測試內容的 IDataCollectionRunContext 物件。
- id
型別:Microsoft.VisualStudio.TestTools.Common.TestExecId
測試 ID。
傳回值
型別:System.Boolean
如果代理程式應該繼續執行測試,則為 true。如果代理程式不應該執行測試,則為 false。
![]() |
---|
傳回 false 時,代理程式會假設外掛程式已報告該項測試失敗,且不會記錄結果。即使傳回 false,外掛程式仍然會針對該項測試引發 TestEnd 事件。 |
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。