加载并返回用于给定测试元素和运行上下文的测试适配器。
命名空间:  Microsoft.VisualStudio.TestTools.Execution
程序集:  Microsoft.VisualStudio.QualityTools.ExecutionCommon(在 Microsoft.VisualStudio.QualityTools.ExecutionCommon.dll 中)
语法
声明
Function GetTestAdapter ( _
    test As ITestElement, _
    runContext As IRunContext _
) As ITestAdapter
ITestAdapter GetTestAdapter(
    ITestElement test,
    IRunContext runContext
)
ITestAdapter^ GetTestAdapter(
    ITestElement^ test, 
    IRunContext^ runContext
)
abstract GetTestAdapter : 
        test:ITestElement * 
        runContext:IRunContext -> ITestAdapter 
function GetTestAdapter(
    test : ITestElement, 
    runContext : IRunContext
) : ITestAdapter
参数
- test
 类型:Microsoft.VisualStudio.TestTools.Common.ITestElement
 一个用于描述加载哪个测试适配器的 ITestElement。
- runContext
 类型:Microsoft.VisualStudio.TestTools.Execution.IRunContext
 测试适配器的 IRunContext。
返回值
类型:Microsoft.VisualStudio.TestTools.TestAdapter.ITestAdapter
当前的 ITestAdapter。
示例
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。