Project.GetTests () 方法

检索此项目的所有测试。

命名空间:Microsoft.Windows.Kits.Hardware.ObjectModel

程序集:Microsoft.Windows.Kits.Hardware.ObjectModel(在 Microsoft.Windows.Kits.Hardware.ObjectModel 中)

语法

Visual Basic

Public Overridable Function GetTests() As IList(Of Test) 
    Dim tests As List(Of Test) = New List(Of Test)()
    For Each productInstance As ProductInstance In Me.GetProductInstances()
        tests.AddRange(productInstance.GetTests())
    NextReturn tests
End Function

C#

public virtual IList<Test> GetTests()
{
    List<Test> tests = new List<Test>();
    foreach (ProductInstance productInstance in this.GetProductInstances())
    {
        tests.AddRange(productInstance.GetTests());
    }
    return tests;
}

返回值

此项目的所有测试的集合。

备注

为了向后兼容 HCK 2.0,返回标记为认证内容级别的测试。 若要获取其他内容级别的测试,请使用获取 ContentLevelType 集合的重载方法。

线程安全

此类型的所有公共静态(在 Visual Basic 中为Shared)成员都是线程安全的。 但不保证所有实例成员都是线程安全的。