BotSharp/BotSharp.UnitTest/IntentTest.cs
2018-04-06 17:39:30 -05:00

26 lines
732 B
C#

using BotSharp.Core.Engines;
using BotSharp.Core.Models;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
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);
var response = rasa.TextRequest(new AIRequest { Query = new String[] { "Hello" } });
Assert.IsTrue(response.Result.Metadata.IntentName == "greeting");
}
}
}