BotSharp/BotSharp.UnitTest/IntentTest.cs

28 lines
768 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
var response = rasa.TextRequest(new AIRequest { Query = new String[] { "Hi" } });
Assert.AreEqual(response.Result.Metadata.IntentName, "greet");
2018-03-28 22:08:49 +00:00
}
}
}