BotSharp/BotSharp.UnitTest/IntentTest.cs

28 lines
798 B
C#
Raw Normal View History

2018-03-28 22:08:49 +00:00
using BotSharp.Core.Engines;
using BotSharp.Core.Models;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
2018-03-28 22:08:49 +00:00
using System.Text;
namespace BotSharp.UnitTest
{
[TestClass]
public class IntentTest : TestEssential
{
[TestMethod]
public void TextRequest()
{
var config = new AIConfiguration(BOT_CLIENT_TOKEN, SupportedLanguage.English);
config.SessionId = Guid.NewGuid().ToString();
var rasa = new RasaAi(dc, config);
2018-05-24 13:10:10 +00:00
// Round 1
2018-06-18 14:15:54 +00:00
var response = rasa.TextRequest(new AIRequest { Query = new String[] { "Can you play country music?" } });
Assert.AreEqual(response.Result.Metadata.IntentName, "music.play");
2018-03-28 22:08:49 +00:00
}
}
}