This repository has been archived by the owner on Jun 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixed stylecop warning * added tests for single-turn completion * stylecop fix * completeasync fix for experimental skills * added nuget source to props file * removed nuget sources from csproj files * [VA] moved myget package source to props file * [Skill] single turn dialog changes * [Skill] moved myget package source to props file
- Loading branch information
1 parent
1d2cefa
commit d3756df
Showing
45 changed files
with
333 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
skills/src/csharp/automotiveskill/automotiveskilltest/Flow/GeneralSkillFlowTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Collections.Specialized; | ||
using System.Threading.Tasks; | ||
using AutomotiveSkill.Responses.Shared; | ||
using Microsoft.Bot.Schema; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace AutomotiveSkillTest.Flow | ||
{ | ||
[TestClass] | ||
public class GeneralSkillFlowTests : AutomotiveSkillTestBase | ||
{ | ||
[TestMethod] | ||
public async Task Test_SingleTurnCompletion() | ||
{ | ||
await this.GetTestFlow() | ||
.Send("what's the weather?") | ||
.AssertReplyOneOf(this.ConfusedResponse()) | ||
.AssertReply((activity) => { Assert.AreEqual(ActivityTypes.Handoff, activity.Type); }) | ||
.StartTestAsync(); | ||
} | ||
|
||
private string[] ConfusedResponse() | ||
{ | ||
return this.ParseReplies(AutomotiveSkillSharedResponses.DidntUnderstandMessage, new StringDictionary()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
skills/src/csharp/calendarskill/calendarskilltest/Flow/GeneralSkillFlowTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System.Collections.Generic; | ||
using System.Collections.Specialized; | ||
using System.Threading.Tasks; | ||
using CalendarSkill.Responses.Shared; | ||
using CalendarSkill.Services; | ||
using CalendarSkillTest.Flow.Fakes; | ||
using CalendarSkillTest.Flow.Utterances; | ||
using Microsoft.Bot.Builder.AI.Luis; | ||
using Microsoft.Bot.Builder.Solutions; | ||
using Microsoft.Bot.Schema; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace CalendarSkillTest.Flow | ||
{ | ||
[TestClass] | ||
public class GeneralSkillFlowTests : CalendarBotTestBase | ||
{ | ||
[TestInitialize] | ||
public void SetupLuisService() | ||
{ | ||
var botServices = Services.BuildServiceProvider().GetService<BotServices>(); | ||
botServices.CognitiveModelSets.Add("en", new CognitiveModelSet() | ||
{ | ||
LuisServices = new Dictionary<string, ITelemetryRecognizer>() | ||
{ | ||
{ "General", new MockLuisRecognizer() }, | ||
{ "Calendar", new MockLuisRecognizer(new BaseTestUtterances()) } | ||
} | ||
}); | ||
} | ||
|
||
/// <summary> | ||
/// Tests that single-turn conversations correctly call CompleteAsync on completion. | ||
/// </summary> | ||
/// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns> | ||
[TestMethod] | ||
public async Task Test_SingleTurnCompletion() | ||
{ | ||
await this.GetTestFlow() | ||
.Send(GeneralTestUtterances.UnknownIntent) | ||
.AssertReplyOneOf(this.ConfusedResponse()) | ||
.AssertReply((activity) => { Assert.AreEqual(ActivityTypes.Handoff, activity.Type); }) | ||
.StartTestAsync(); | ||
} | ||
|
||
private string[] ConfusedResponse() | ||
{ | ||
return this.ParseReplies(CalendarSharedResponses.DidntUnderstandMessage, new StringDictionary()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
skills/src/csharp/emailskill/emailskilltest/Flow/GeneralSkillFlowTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Collections.Specialized; | ||
using System.Threading.Tasks; | ||
using EmailSkill.Responses.Shared; | ||
using EmailSkillTest.Flow.Utterances; | ||
using Microsoft.Bot.Schema; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace EmailSkillTest.Flow | ||
{ | ||
[TestClass] | ||
public class GeneralSkillFlowTests : EmailBotTestBase | ||
{ | ||
[TestMethod] | ||
public async Task Test_SingleTurnCompletion() | ||
{ | ||
await this.GetTestFlow() | ||
.Send(GeneralTestUtterances.UnknownIntent) | ||
.AssertReplyOneOf(this.ConfusedResponse()) | ||
.AssertReply((activity) => { Assert.AreEqual(ActivityTypes.Handoff, activity.Type); }) | ||
.StartTestAsync(); | ||
} | ||
|
||
private string[] ConfusedResponse() | ||
{ | ||
return this.ParseReplies(EmailSharedResponses.DidntUnderstandMessage, new StringDictionary()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.