Auto testing for Microsoft Bot Framework(Microsoft Bot Framework 的自动测试)
问题描述
我现在正在使用 Microsoft Bot Framework 和 ASP.NET 开发我的第一个机器人.
I'm working now on my first bot with Microsoft Bot Framework, with ASP.NET.
在使用机器人模拟器手动测试后,我正在寻找为机器人创建自动测试的最佳方法.
After manually testing with the bot emulator, I'm looking for the best method to create automatic testing for the bot.
考虑两个问题:
- 自动化此类测试的最佳工具是什么?
- 测试可以对同一输入返回不同答案的对话框的最佳方法是什么?
推荐答案
另一种方法是使用 DirectLine 进行功能测试.需要注意的是,该机器人需要托管,但它很强大.查看 AzureBot 测试项目 了解其工作原理.
One alternative is doing functional tests using DirectLine. The caveat is that the bot needs to be hosted but it's powerfull. Check out the AzureBot tests project to see how this works.
另一种选择是做 BotFramework 团队正在为他们的一些单元测试做的事情.
Another alternative, is doing what the BotFramework team is doing for some of their unit tests.
如果您使用对话框,可以查看 EchoBot 单元测试 因为它们很容易理解.
If you are using Dialogs, you can take a look to the EchoBot unit tests as they are simple to follow.
如果你使用的是 Chain,那么看看他们是如何使用 AssertScriptAsync 方法的.
If you are using Chain, then take a look to how their are using the AssertScriptAsync method.
https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Tests/Microsoft.Bot.Builder.Tests/ChainTests.cs#L360
https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Tests/Microsoft.Bot.Builder.Tests/ChainTests.cs#L538
如果您正在寻找模拟 Luis 服务的方法,请参阅 this.
If you are looking for a way to mock up Luis Service, see this.
这篇关于Microsoft Bot Framework 的自动测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Microsoft Bot Framework 的自动测试
基础教程推荐
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
