Share via


TestScript Class

Definition

A mock Test Script that can be used for unit testing of bot logic.

public class TestScript
type TestScript = class
Public Class TestScript
Inheritance
TestScript

Remarks

You can use this class to mimic input from a a user or a channel to validate that the bot or adapter responds as expected.

Constructors

TestScript()

Initializes a new instance of the TestScript class.

Fields

Kind

Sets the Kind for this class.

TestScriptEnded

Test script ended event.

Properties

Configuration

Gets or sets configuration to use for the test.

Description

Gets or sets the description property.

Dialog

Gets or sets the RootDialog.

EnableTrace

Gets or sets a value indicating whether trace activities should be passed to the test script.

HttpRequestMocks

Gets the mock data for Microsoft.HttpRequest.

LanguagePolicy

Gets or sets the language policy.

Locale

Gets or sets the locale.

Script

Gets the test script actions.

SettingMocks

Gets the mock data for setting.

UserTokenMocks

Gets the mock data for Microsoft.OAuthInput.

Methods

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

Adds an assertion that the turn processing logic responds as expected.

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

Adds an assertion that the turn processing logic responds as expected.

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

Adds an assertion that the turn processing logic responds as expected.

DefaultTestAdapter(ResourceExplorer, String, IEnumerable<IMiddleware>)

Build default test adapter.

Delay(TimeSpan, String, Int32)

Adds a delay in the conversation.

Delay(UInt32, String, Int32)

Adds a delay in the conversation.

Event(String, Object, String, Int32)

Adds a user options.

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

Starts the execution of the test sequence.

Send(IActivity, String, Int32)

Adds an activity from the user to the bot.

Send(String, String, Int32)

Adds a message activity from the user to the bot.

SendConversationUpdate(String, Int32)

Sends conversation update.

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

Shortcut for calling Send(String, String, Int32) followed by AssertReply(String, String, UInt32, String[], String, Int32).

Applies to

See also