TestScript 类

定义

可用于机器人逻辑的单元测试的模拟测试脚本。

public class TestScript
type TestScript = class
Public Class TestScript
继承
TestScript

注解

可以使用此类来模拟来自用户或通道的输入,以验证机器人或适配器是否按预期进行响应。

构造函数

TestScript()

初始化 TestScript 类的新实例。

字段

Kind

设置此类的 Kind。

TestScriptEnded

测试脚本结束事件。

属性

Configuration

获取或设置要用于测试的配置。

Description

获取或设置 description 属性。

Dialog

获取或设置 RootDialog。

EnableTrace

获取或设置一个值,该值指示是否应将跟踪活动传递给测试脚本。

HttpRequestMocks

获取 Microsoft.HttpRequest 的模拟数据。

LanguagePolicy

获取或设置语言策略。

Locale

获取或设置区域设置。

Script

获取测试脚本操作。

SettingMocks

获取用于设置的模拟数据。

UserTokenMocks

获取 Microsoft.OAuthInput 的模拟数据。

方法

AssertReply(String, String, UInt32, String[], String, Int32)

添加一个断言,指示轮次处理逻辑按预期响应。

AssertReplyActivity(String[], String, UInt32, String, Int32)

添加一个断言,指示轮次处理逻辑按预期响应。

AssertReplyContains(String, String, UInt32, String, Int32)

添加一个断言,指示轮次处理逻辑按预期响应。

DefaultTestAdapter(ResourceExplorer, String, IEnumerable<IMiddleware>)

生成默认测试适配器。

Delay(TimeSpan, String, Int32)

在会话中添加延迟。

Delay(UInt32, String, Int32)

在会话中添加延迟。

Event(String, Object, String, Int32)

添加用户选项。

ExecuteAsync(ResourceExplorer, String, BotCallbackHandler, TestAdapter, IEnumerable<IMiddleware>)

开始执行测试序列。

Send(IActivity, String, Int32)

将活动从用户添加到机器人。

Send(String, String, Int32)

将来自用户的消息活动添加到机器人。

SendConversationUpdate(String, Int32)

发送对话更新。

Test(String, String, String, UInt32, String, Int32)

用于调用 Send(String, String, Int32) 的快捷方式, AssertReply(String, String, UInt32, String[], String, Int32)后跟 。

适用于

另请参阅