在测试启动之前调用此方法。
命名空间: 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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。