botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

How to write unit testing for bot application?

Open Masssluis opened this issue 9 years ago • 5 comments

I am new to creating bot application using Luis. i want to write the unit test cases for simple bot application using Luis. I already gone through the examples and spend a lot of time on this to understand the test cases which are given in this website.Still didn't understand anyone.Can anyone please give me the very simple test case for bot application using Luis for understanding purpose.

Masssluis avatar Dec 05 '16 06:12 Masssluis

in Node.js or C# ?

danmarshall avatar Dec 05 '16 07:12 danmarshall

In C#

Masssluis avatar Dec 05 '16 07:12 Masssluis

We based ours on an adaptation from https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Tests/Microsoft.Bot.Builder.Tests/DialogTaskTests.cs

vossccp avatar Dec 05 '16 15:12 vossccp

@Masssluis we have a full example test that mocks the LUIS service here: https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Tests/Microsoft.Bot.Sample.Tests/AlarmBotTests.cs#L72

otherwise, we tend to use AssertScriptAsync: https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Tests/Microsoft.Bot.Builder.Tests/ChainTests.cs#L513

willportnoy avatar Dec 07 '16 19:12 willportnoy

I'm going to close this issue for now, but feel free to open a new issue for further discussion.

willportnoy avatar Dec 12 '16 20:12 willportnoy