I would like to test the bot ability to respond with choices prompts and be able to answer those prompts.
So for:
var salesData = {
"west": {
units: 200,
total: "$6,000"
},
"central": {
units: 100,
total: "$3,000"
},
"east": {
units: 300,
total: "$9,000"
}
};
bot.dialog('getSalesData', [
function (session) {
builder.Prompts.choice(session, "Which region would you like sales for?", salesData);
},
function (session, results) {
if (results.response) {
var region = salesData[results.response.entity];
session.send(`We sold ${region.units} units for a total of ${region.total}.`);
} else {
session.send("OK");
}
}
]);
var expectedChoicePrompt = PromptChoice("Which region would you like sales for?", salesData)
new BotTester(bot)
.sendMessageToBot("hello", expectedChoicePrompt)
.sendMessageToBot("central", " We sold 100 units for a total of \"300$\".")
.runTest();