TestAdapter TestAdapter TestAdapter Class

Definition

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

public class TestAdapter : Microsoft.Bot.Builder.BotAdapter
type TestAdapter = class
    inherit BotAdapter
Public Class TestAdapter
Inherits BotAdapter
Inheritance
TestAdapterTestAdapterTestAdapter

Constructors

TestAdapter(ConversationReference, Boolean) TestAdapter(ConversationReference, Boolean) TestAdapter(ConversationReference, Boolean)

Initializes a new instance of the TestAdapter class.

Properties

ActiveQueue ActiveQueue ActiveQueue

Gets the queue of responses from the bot.

Conversation Conversation Conversation

Gets or sets a reference to the current coversation.

MiddlewareSet MiddlewareSet MiddlewareSet

Gets the collection of middleware in the adapter's pipeline.

(Inherited from BotAdapter)
OnTurnError OnTurnError OnTurnError

Gets or sets an error handler that can catche exceptions in the middleware or application.

(Inherited from BotAdapter)

Methods

ContinueConversationAsync(String, ConversationReference, BotCallbackHandler, CancellationToken) ContinueConversationAsync(String, ConversationReference, BotCallbackHandler, CancellationToken) ContinueConversationAsync(String, ConversationReference, BotCallbackHandler, CancellationToken)

Sends a proactive message to a conversation.

(Inherited from BotAdapter)
CreateConversationAsync(String, BotCallbackHandler, CancellationToken) CreateConversationAsync(String, BotCallbackHandler, CancellationToken) CreateConversationAsync(String, BotCallbackHandler, CancellationToken)

Creates a new conversation on the specified channel.

DeleteActivityAsync(ITurnContext, ConversationReference, CancellationToken) DeleteActivityAsync(ITurnContext, ConversationReference, CancellationToken) DeleteActivityAsync(ITurnContext, ConversationReference, CancellationToken)

Deletes an existing activity in the ActiveQueue.

GetNextReply() GetNextReply() GetNextReply()

Dequeues and returns the next bot response from the ActiveQueue.

MakeActivity(String) MakeActivity(String) MakeActivity(String)

Creates a message activity from text and the current conversational context.

ProcessActivityAsync(Activity, BotCallbackHandler, CancellationToken) ProcessActivityAsync(Activity, BotCallbackHandler, CancellationToken) ProcessActivityAsync(Activity, BotCallbackHandler, CancellationToken)

Receives an activity and runs it through the middleware pipeline.

RunPipelineAsync(ITurnContext, BotCallbackHandler, CancellationToken) RunPipelineAsync(ITurnContext, BotCallbackHandler, CancellationToken) RunPipelineAsync(ITurnContext, BotCallbackHandler, CancellationToken)

Starts activity processing for the current bot turn.

(Inherited from BotAdapter)
SendActivitiesAsync(ITurnContext, Activity[], CancellationToken) SendActivitiesAsync(ITurnContext, Activity[], CancellationToken) SendActivitiesAsync(ITurnContext, Activity[], CancellationToken)

Sends activities to the conversation.

SendTextToBotAsync(String, BotCallbackHandler, CancellationToken) SendTextToBotAsync(String, BotCallbackHandler, CancellationToken) SendTextToBotAsync(String, BotCallbackHandler, CancellationToken)

Processes a message activity from a user.

UpdateActivityAsync(ITurnContext, Activity, CancellationToken) UpdateActivityAsync(ITurnContext, Activity, CancellationToken) UpdateActivityAsync(ITurnContext, Activity, CancellationToken)

Replaces an existing activity in the ActiveQueue.

Use(IMiddleware) Use(IMiddleware) Use(IMiddleware)

Adds middleware to the adapter's pipeline.

Applies to

See also