Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion libraries/botbuilder-core/src/testAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,22 @@ export class TestAdapter extends BotAdapter implements IUserTokenProvider {
if (!request.id) { request.id = (this.nextId++).toString(); }

// Create context object and run middleware
const context: TurnContext = new TurnContext(this, request);
const context: TurnContext = this.createContext(request);

return this.runMiddleware(context, this.logic);
}

/**
* Creates a turn context.
*
* @param request An incoming request body.
*
* @remarks
* Override this in a derived class to modify how the adapter creates a turn context.
*/
protected createContext(request: Partial<Activity>): TurnContext {
return new TurnContext(this, request);
}
/**
* Sends something to the bot. This returns a new `TestFlow` instance which can be used to add
* additional steps for inspecting the bots reply and then sending additional activities.
Expand Down