TestFlow TestFlow TestFlow Class

Definition

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

public class TestFlow
type TestFlow = class
Public Class TestFlow
Inheritance
TestFlowTestFlowTestFlow

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

TestFlow(TestAdapter, BotCallbackHandler) TestFlow(TestAdapter, BotCallbackHandler) TestFlow(TestAdapter, BotCallbackHandler)

Initializes a new instance of the TestFlow class.

TestFlow(TestAdapter, IBot) TestFlow(TestAdapter, IBot) TestFlow(TestAdapter, IBot)

Initializes a new instance of the TestFlow class.

TestFlow(Task, TestFlow) TestFlow(Task, TestFlow) TestFlow(Task, TestFlow)

Initializes a new instance of the TestFlow class from an existing flow.

Methods

AssertReply(IActivity, String, UInt32) AssertReply(IActivity, String, UInt32) AssertReply(IActivity, String, UInt32)

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

AssertReply(Action<IActivity>, String, UInt32) AssertReply(Action<IActivity>, String, UInt32) AssertReply(Action<IActivity>, String, UInt32)

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

AssertReply(String, String, UInt32) AssertReply(String, String, UInt32) AssertReply(String, String, UInt32)

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

AssertReplyOneOf(String[], String, UInt32) AssertReplyOneOf(String[], String, UInt32) AssertReplyOneOf(String[], String, UInt32)

Adds an assertion that the bot's response is contained within a set of acceptable responses.

Delay(UInt32) Delay(UInt32) Delay(UInt32)

Adds a delay in the conversation.

Send(IActivity) Send(IActivity) Send(IActivity)

Adds an activity from the user to the bot.

Send(String) Send(String) Send(String)

Adds a message activity from the user to the bot.

StartTestAsync() StartTestAsync() StartTestAsync()

Starts the execution of the test flow.

Test(IEnumerable<IActivity>, String, UInt32) Test(IEnumerable<IActivity>, String, UInt32) Test(IEnumerable<IActivity>, String, UInt32)

Shorcut for adding an arbitray exchange between the user and bot. Each activity with a From.Role equals to "bot" will be processed with the AssertReply(IActivity, String, UInt32) method. Every other activity will be processed as user's message via the Send(IActivity) method.

Test(IEnumerable<IActivity>, ValidateReply, String, UInt32) Test(IEnumerable<IActivity>, ValidateReply, String, UInt32) Test(IEnumerable<IActivity>, ValidateReply, String, UInt32)

Shorcut for adding an arbitray exchange between the user and bot. Each activity with a From.Role equals to "bot" will be processed with the AssertReply(IActivity, String, UInt32) method. Every other activity will be processed as user's message via the Send(IActivity) method.

Test(String, Activity, String, UInt32) Test(String, Activity, String, UInt32) Test(String, Activity, String, UInt32)

Shortcut for calling Send(String) followed by AssertReply(IActivity, String, UInt32).

Test(String, Action<IActivity>, String, UInt32) Test(String, Action<IActivity>, String, UInt32) Test(String, Action<IActivity>, String, UInt32)

Shortcut for calling Send(String) followed by AssertReply(Action<IActivity>, String, UInt32).

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

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

Applies to

See also