Share via


TestFlow.Test Method

Definition

Overloads

Test(IEnumerable<IActivity>, String, UInt32)

Shortcut for adding an arbitrary 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)

Shortcut for adding an arbitrary 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)

Shortcut for calling Send(String) followed by AssertReply(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)

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

Test(IEnumerable<IActivity>, String, UInt32)

Shortcut for adding an arbitrary 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.

public Microsoft.Bot.Builder.Adapters.TestFlow Test (System.Collections.Generic.IEnumerable<Microsoft.Bot.Schema.IActivity> activities, string description = default, uint timeout = 3000);
member this.Test : seq<Microsoft.Bot.Schema.IActivity> * string * uint32 -> Microsoft.Bot.Builder.Adapters.TestFlow
Public Function Test (activities As IEnumerable(Of IActivity), Optional description As String = Nothing, Optional timeout As UInteger = 3000) As TestFlow

Parameters

activities
IEnumerable<IActivity>

The list of activities to test.

description
String

A message to send if the actual response is not as expected.

timeout
UInt32

The amount of time in milliseconds within which a response is expected.

Returns

A new TestFlow object that appends this exchange to the modeled exchange.

Exceptions

The bot did not respond as expected.

Remarks

This method does not modify the original TestFlow object.

Applies to

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

Shortcut for adding an arbitrary 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.

public Microsoft.Bot.Builder.Adapters.TestFlow Test (System.Collections.Generic.IEnumerable<Microsoft.Bot.Schema.IActivity> activities, Microsoft.Bot.Builder.Adapters.ValidateReply validateReply, string description = default, uint timeout = 3000);
member this.Test : seq<Microsoft.Bot.Schema.IActivity> * Microsoft.Bot.Builder.Adapters.ValidateReply * string * uint32 -> Microsoft.Bot.Builder.Adapters.TestFlow
Public Function Test (activities As IEnumerable(Of IActivity), validateReply As ValidateReply, Optional description As String = Nothing, Optional timeout As UInteger = 3000) As TestFlow

Parameters

activities
IEnumerable<IActivity>

The list of activities to test.

validateReply
ValidateReply

The delegate to call to validate responses from the bot.

description
String

A message to send if the actual response is not as expected.

timeout
UInt32

The amount of time in milliseconds within which a response is expected.

Returns

A new TestFlow object that appends this exchange to the modeled exchange.

Exceptions

The bot did not respond as expected.

Remarks

This method does not modify the original TestFlow object.

Applies to

Test(String, Activity, String, UInt32)

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

public Microsoft.Bot.Builder.Adapters.TestFlow Test (string userSays, Microsoft.Bot.Schema.Activity expected, string description = default, uint timeout = 3000);
member this.Test : string * Microsoft.Bot.Schema.Activity * string * uint32 -> Microsoft.Bot.Builder.Adapters.TestFlow
Public Function Test (userSays As String, expected As Activity, Optional description As String = Nothing, Optional timeout As UInteger = 3000) As TestFlow

Parameters

userSays
String

The text of the message to send.

expected
Activity

The expected activity from the bot.

description
String

A message to send if the actual response is not as expected.

timeout
UInt32

The amount of time in milliseconds within which a response is expected.

Returns

A new TestFlow object that appends this exchange to the modeled exchange.

Exceptions

The bot did not respond as expected.

Remarks

This method does not modify the original TestFlow object.

Applies to

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

public Microsoft.Bot.Builder.Adapters.TestFlow Test (string userSays, Action<Microsoft.Bot.Schema.IActivity> validateActivity, string description = default, uint timeout = 3000);
member this.Test : string * Action<Microsoft.Bot.Schema.IActivity> * string * uint32 -> Microsoft.Bot.Builder.Adapters.TestFlow
Public Function Test (userSays As String, validateActivity As Action(Of IActivity), Optional description As String = Nothing, Optional timeout As UInteger = 3000) As TestFlow

Parameters

userSays
String

The text of the message to send.

validateActivity
Action<IActivity>

A validation method to apply to an activity from the bot. This activity should throw an exception if validation fails.

description
String

A message to send if the actual response is not as expected.

timeout
UInt32

The amount of time in milliseconds within which a response is expected.

Returns

A new TestFlow object that appends this exchange to the modeled exchange.

Exceptions

The bot did not respond as expected.

Remarks

This method does not modify the original TestFlow object.

Applies to

Test(String, String, String, UInt32)

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

public Microsoft.Bot.Builder.Adapters.TestFlow Test (string userSays, string expected, string description = default, uint timeout = 3000);
member this.Test : string * string * string * uint32 -> Microsoft.Bot.Builder.Adapters.TestFlow
Public Function Test (userSays As String, expected As String, Optional description As String = Nothing, Optional timeout As UInteger = 3000) As TestFlow

Parameters

userSays
String

The text of the message to send.

expected
String

The expected text of a message from the bot.

description
String

A message to send if the actual response is not as expected.

timeout
UInt32

The amount of time in milliseconds within which a response is expected.

Returns

A new TestFlow object that appends this exchange to the modeled exchange.

Exceptions

The bot did not respond as expected.

Remarks

This method does not modify the original TestFlow object.

Applies to