public async Task QnaMaker_TestThreshold() { var qna = new QnAMakerMiddleware(new QnAMakerOptions() { KnowledgeBaseId = knowlegeBaseId, SubscriptionKey = subscriptionKey, Top = 1, ScoreThreshold = 0.99F }, new HttpClient()); var results = await qna.GetAnswers("how do I clean the stove?"); Assert.IsNotNull(results); Assert.AreEqual(results.Length, 0, "should get zero result because threshold"); }
public async Task QnaMaker_ReturnsAnswer() { var qna = new QnAMakerMiddleware(new QnAMakerOptions() { KnowledgeBaseId = knowlegeBaseId, SubscriptionKey = subscriptionKey, Top = 1 }, new HttpClient()); var results = await qna.GetAnswers("how do I clean the stove?"); Assert.IsNotNull(results); Assert.AreEqual(results.Length, 1, "should get one result"); Assert.IsTrue(results[0].Answer.StartsWith("BaseCamp: You can use a damp rag to clean around the Power Pack")); }