語言

TestScript 類別

定義

一個可用於機器人邏輯單元測試的模擬測試腳本。

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

備註

你可以用這個類別來模擬使用者或通道的輸入,來驗證機器人或介面卡是否如預期回應。

建構函式

名稱 Description
TestScript()

初始化 TestScript 類別的新執行個體。

欄位

名稱 Description
Kind

為這個職業設定了種類。

TestScriptEnded

測試腳本事件結束。

屬性

名稱 Description
Configuration

取得或設定用於測試的設定。

Description

取得或設定描述屬性。

Dialog

取得或設定 RootDialog。

EnableTrace

取得或設定一個值,指示是否應該將追蹤活動傳給測試腳本。

HttpRequestMocks

取得 Microsoft.HttpRequest 的模擬數據。

LanguagePolicy

取得或設定語言政策。

Locale

取得或設定場景。

Script

能取得測試腳本的動作。

SettingMocks

取得模擬資料以進行設定。

UserTokenMocks

取得 Microsoft 的模擬資料。OAuthInput。

方法

名稱 Description
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)的捷徑。

適用於

另請參閱