gudwin / botbuilder-unit

Library for Microsoft Bot Framework Chatbot unit testing
GNU Lesser General Public License v3.0
11 stars 7 forks source link

Is it possible to test backchannel events? #6

Open cdagli opened 6 years ago

cdagli commented 6 years ago

Hello,

Is it possible to add some steps to test the backchannel events documented there: https://docs.microsoft.com/en-us/azure/bot-service/nodejs/bot-builder-nodejs-backchannel?view=azure-bot-service-3.0

Thanks

enessoylu commented 6 years ago

You can do this in TypeScript like:

import { Message } from 'botbuilder'; 

export class MockBackchannelEvent extends Message
{
    constructor(private event: EventActivity)
    {
        super();
    }

    public toMessage(): any
    {
        return {
            ...super.toMessage(),
            ...this.event
        };
    }
}