Skip to content

Commit

Permalink
Update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
luhan2017 committed Dec 16, 2019
1 parent bf051f3 commit 37e45f0
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 74 deletions.
10 changes: 5 additions & 5 deletions BotProject/Templates/CSharp/Tests/InputsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,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 @@ -64,7 +64,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 @@ -80,7 +80,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 @@ -95,7 +95,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 @@ -107,7 +107,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/Templates/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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# help
-```Welcome to Input Sample Bot.
I can show you examples on how to use actions, You can enter number 01-04
I can show you examples on how to use actions, You can enter number 01-07
01 - TextInput
02 - NumberInput
03 - ConfirmInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,22 @@ Here's what I know about you -
- Sure, I've cancelled that.

# bfdactivity-296924
- Hello @{user.profile.name}, I have your age as @{user.profile.age}. \n \[Suggestions=Reset profile]
[Activity
Text = Hello @{user.profile.name}, I have your age as @{user.profile.age}.
SuggestedActions = Reset profile
]

# bfdactivity-907674
- I need your age to customize recommediations. \n \[Suggestions=No age | Reset profile | Cancel]
[Activity
Text = I need your age to customize recommediations.
SuggestedActions = No age | Reset profile | Cancel
]

# bfdactivity-558329
- I need your name to address you correctly! \n \[Suggestions=No name | Reset profile | Cancel]
[Activity
Text = I need your name to address you correctly!
SuggestedActions = No name | Reset profile | Cancel
]

# bfdactivity-074631
- No worries. I'll set your age to 30 for now.
Expand All @@ -47,13 +56,25 @@ Here's what I know about you -
- @{user.profile.name}

# bfdactivity-924700
- Hello, I'm the interruption sample bot! \n \[Suggestions=Get started | Reset profile | Cancel | Show profile]
[Activity
Text = Hello, I'm the interruption sample bot!
SuggestedActions = Get started | Reset profile | Cancel | Show profile
]

# bfdactivity-032735
- I've reset your profile. \n \[Suggestions=Get started]
[Activity
Text = I've reset your profile.
SuggestedActions = Get started
]

# bfdinvalidPrompt-362298
- Sorry, '@{this.value}' does not work. I'm looking for 2-150 characters. What is your name? \n \[Suggestions=Why? | No name | Cancel | Reset profile\]
[Activity
Text = Sorry, '@{this.value}' does not work. I'm looking for 2-150 characters. What is your name?
SuggestedActions = Why? | No name | Cancel | Reset profile
]

# bfdinvalidPrompt-005947
- Sorry, @{this.value} does not work. I'm looking for a value between 1-150. What is your age? \n \[Suggestions=Why? | Reset profile | Cancel | No age\]
[Activity
Text = Sorry, @{this.value} does not work. I'm looking for a value between 1-150. What is your age?
SuggestedActions = Why? | Reset profile | Cancel | No age
]
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@
{
"value": "Text With Memory"
},
{
"value": "Text With LG"
},
{
"value": "LGWithParam"
},
Expand Down Expand Up @@ -126,18 +123,6 @@
}
]
},
{
"value": "Text With LG",
"actions": [
{
"$type": "Microsoft.BeginDialog",
"$designer": {
"id": "791050"
},
"dialog": "TextWithLG"
}
]
},
{
"value": "LGWithParam",
"actions": [
Expand Down

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
# LGWithParam(user)
- Hello @{user.name}, nice to talk to you!

# TextWithLG
- Hi, this is a text with LG
- Hey, this is a text with LG
- Hello, this is a text with LG
# SimpleText
- Hi, this is simple text
- Hey, this is simple text
- Hello, this is simple text

# help
- ```
Expand All @@ -24,7 +24,7 @@
-@{LGWithParam(user)}

# bfdactivity-219943
-@{TextWithLG()}
-@{SimpleText()}

# bfdactivity-822060
-@{user.message}
Expand All @@ -44,9 +44,6 @@
-DEFAULT:
- Working day!

# bfdactivity-739923
- @{TextWithLG()}

# bfdactivity-853358
- @{multilineText()}

Expand Down

0 comments on commit 37e45f0

Please sign in to comment.