Version: 6000.3
语言: 中文
检索测试结果
在播放器中运行播放模式测试

检索测试列表

您可以使用TestRunnerApi检索给定测试模式(编辑模式或播放模式)的测试树。您可以通过调用RetrieveTestList与所需的TestMode和回调作,带有ITestAdaptor表示测试树。

以下示例检索编辑模式测试的测试树,并打印测试用例总数:

var api = ScriptableObject.CreateInstance<TestRunnerApi>();
api.RetrieveTestList(TestMode.EditMode, (testRoot) =>
{
    Debug.Log(string.Format("Tree contains {0} tests.", testRoot.TestCaseCount));
});

其他资源

检索测试结果
在播放器中运行播放模式测试