/// import * as Promise from 'bluebird'; import { IMessage, UniversalBot } from 'botbuilder'; import { IConfig } from './config'; import { ExpectedMessage } from './ExpectedMessage'; export declare type botToUserMessageCheckerFunction = (msg: IMessage | IMessage[]) => void; /** * Handles sending messages to bot, intercepts the responses, and compares the response to the expected responses for the particular test * step */ export declare class MessageService { private bot; private botToUserMessageChecker; private config; constructor(bot: UniversalBot, config: IConfig); /** * Sends message to bot and sets the expectations for the responses. * * @param message message to send to bot * @param expectedResponses expected responses */ sendMessageToBot(message: IMessage, expectedResponses: ExpectedMessage[], ignoreOrder?: boolean): Promise; /** * Sets the current response expectation function for the message service. This allows the botToUserMessageChecker property to be * updated within a closure with the proper expectedResponses. The promise that is returned will only resolve when all responses have * been seen. Many tests will hang here and fail if an expected response is never received * * @param expectedResponses collection of expected responses for a particular step */ private setBotToUserMessageChecker(expectedResponses, outgoingMessageComparator); /** * Inject middleware to intercept outgoing messages to check their content */ private applyOutgoingMessageListener(); }