Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update schema and samples #1735

Merged
merged 12 commits into from
Dec 18, 2019
Merged
10 changes: 5 additions & 5 deletions BotProject/CSharp/Tests/InputsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task Inputs_01TextInput()
{
await BuildTestFlow()
.SendConversationUpdate()
.AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine))
.AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-07{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine))
.Send("01")
.AssertReply("Hello, I'm Zoidberg. What is your name? (This can't be interrupted)")
.Send("02")
Expand All @@ -67,7 +67,7 @@ public async Task Inputs_02NumberInput()
{
await BuildTestFlow()
.SendConversationUpdate()
.AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine))
.AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-07{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine))
.Send("02")
.AssertReply("What is your age?")
.Send("18")
Expand All @@ -83,7 +83,7 @@ public async Task Inputs_03ConfirmInput()
{
await BuildTestFlow()
.SendConversationUpdate()
.AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine))
.AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-07{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine))
.Send("03")
.AssertReply("yes or no (1) Yes or (2) No")
.Send("asdasd")
Expand All @@ -98,7 +98,7 @@ public async Task Inputs_04ChoiceInput()
{
await BuildTestFlow()
.SendConversationUpdate()
.AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine)).Send("04")
.AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-07{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine)).Send("04")
.AssertReply("Please select a value from below:\n\n 1. Test1\n 2. Test2\n 3. Test3")
.Send("Test1")
.AssertReply("You select: Test1")
Expand All @@ -110,7 +110,7 @@ public async Task Inputs_06DateTimeInput()
{
await BuildTestFlow()
.SendConversationUpdate()
.AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-04{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine)).Send("06")
.AssertReply(String.Format("Welcome to Input Sample Bot.{0}I can show you examples on how to use actions, You can enter number 01-07{0}01 - TextInput{0}02 - NumberInput{0}03 - ConfirmInput{0}04 - ChoiceInput{0}05 - AttachmentInput{0}06 - DateTimeInput{0}07 - OAuthInput{0}", Environment.NewLine)).Send("06")
.AssertReply("Please enter a date.")
.Send("June 1st")
.AssertReply("You entered: 2019-06-01")
Expand Down
17 changes: 7 additions & 10 deletions BotProject/CSharp/Tests/MessageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,21 @@ public async Task MessageTest()
{
await BuildTestFlow()
.SendConversationUpdate()
.AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. Text With LG\n 4. LGWithParam\n 5. LGComposition\n 6. Structured LG\n 7. MultiLineText\n 8. IfElseCondition\n 9. SwitchCondition")
.AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. LGWithParam\n 4. LGComposition\n 5. Structured LG\n 6. MultiLineText\n 7. IfElseCondition\n 8. SwitchCondition")
.Send("1")
.AssertReplyOneOf(new string[] { "Hello, this is a text with LG", "Hi, this is a text with LG", "Hey, this is a text with LG" })
.AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. Text With LG\n 4. LGWithParam\n 5. LGComposition\n 6. Structured LG\n 7. MultiLineText\n 8. IfElseCondition\n 9. SwitchCondition")
.AssertReplyOneOf(new string[] { "Hi, this is simple text", "Hey, this is simple text", "Hello, this is simple text" })
.AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. LGWithParam\n 4. LGComposition\n 5. Structured LG\n 6. MultiLineText\n 7. IfElseCondition\n 8. SwitchCondition")
.Send("2")
.AssertReply("This is a text saved in memory.")
.AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. Text With LG\n 4. LGWithParam\n 5. LGComposition\n 6. Structured LG\n 7. MultiLineText\n 8. IfElseCondition\n 9. SwitchCondition")
.AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. LGWithParam\n 4. LGComposition\n 5. Structured LG\n 6. MultiLineText\n 7. IfElseCondition\n 8. SwitchCondition")
.Send("3")
.AssertReplyOneOf(new string[] { "Hello, this is a text with LG", "Hi, this is a text with LG", "Hey, this is a text with LG" })
.AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. Text With LG\n 4. LGWithParam\n 5. LGComposition\n 6. Structured LG\n 7. MultiLineText\n 8. IfElseCondition\n 9. SwitchCondition")
.Send("4")
.AssertReply("Hello, I'm Zoidberg. What is your name?")
.Send("luhan")
.AssertReply("Hello luhan, nice to talk to you!")
.AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. Text With LG\n 4. LGWithParam\n 5. LGComposition\n 6. Structured LG\n 7. MultiLineText\n 8. IfElseCondition\n 9. SwitchCondition")
.Send("5")
.AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. LGWithParam\n 4. LGComposition\n 5. Structured LG\n 6. MultiLineText\n 7. IfElseCondition\n 8. SwitchCondition")
.Send("4")
.AssertReply("luhan nice to talk to you!")
.AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. Text With LG\n 4. LGWithParam\n 5. LGComposition\n 6. Structured LG\n 7. MultiLineText\n 8. IfElseCondition\n 9. SwitchCondition")
.AssertReply("What type of message would you like to send?\n\n 1. Simple Text\n 2. Text With Memory\n 3. LGWithParam\n 4. LGComposition\n 5. Structured LG\n 6. MultiLineText\n 7. IfElseCondition\n 8. SwitchCondition")
.StartTestAsync();
}

Expand Down
20 changes: 10 additions & 10 deletions BotProject/Templates/CSharp/BotProject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.4" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.6.0" />
<PackageReference Include="Microsoft.Bot.Builder.ApplicationInsights" Version="4.6.0" />
<PackageReference Include="Microsoft.Bot.Builder.Azure" Version="4.6.0" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Adaptive" Version="4.6.0-preview2" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Debugging" Version="4.6.0-preview2" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Declarative" Version="4.6.0-preview2" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.6.0" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.6.0" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.6.0" />
<PackageReference Include="Microsoft.Bot.Connector" Version="4.6.0" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.7.0-preview-191208-1" />
<PackageReference Include="Microsoft.Bot.Builder.ApplicationInsights" Version="4.7.0-preview-191208-1" />
<PackageReference Include="Microsoft.Bot.Builder.Azure" Version="4.7.0-preview-191208-1" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Adaptive" Version="4.7.0-preview-191208-1" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Debugging" Version="4.7.0-preview-191208-1" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Declarative" Version="4.7.0-preview-191208-1" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.7.0-preview-191208-1" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.7.0-preview-191208-1" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.7.0-preview-191208-1" />
<PackageReference Include="Microsoft.Bot.Connector" Version="4.7.0-preview-191208-1" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66">
<PrivateAssets>all</PrivateAssets>
Expand Down
Loading