Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public abstract class InputDialog : Dialog
var (value, error) = this.DefaultValue.TryGetValue(dc.State);
if (this.DefaultValueResponse != null)
{
var response = await this.DefaultValueResponse.BindAsync(dc, cancellationToken).ConfigureAwait(false);
var response = await this.DefaultValueResponse.BindAsync(dc, cancellationToken: cancellationToken).ConfigureAwait(false);
Comment thread
cosmicshuai marked this conversation as resolved.

var properties = new Dictionary<string, string>()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public class OAuthInput : InputDialog
var (value, _) = this.DefaultValue.TryGetValue(dc.State);
if (this.DefaultValueResponse != null)
{
var response = await this.DefaultValueResponse.BindAsync(dc, cancellationToken).ConfigureAwait(false);
var response = await this.DefaultValueResponse.BindAsync(dc, cancellationToken: cancellationToken).ConfigureAwait(false);
var properties = new Dictionary<string, string>()
{
{ "template", JsonConvert.SerializeObject(this.DefaultValueResponse) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ public async Task Action_NumberInputWithVAlueExpression()
await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
}

[Fact]
public async Task Action_NumberInputWithDefaultResponse()
{
await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
}

[Fact]
public async Task Action_RepeatDialog()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Tests\ActionTests\Action_NumberInputWithDefaultResponse.test.dialog">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Tests\AskTests\Action_AskRetriesDeleteProperties.test.dialog">
<SubType>Component</SubType>
</None>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"$schema": "../../../tests.schema",
"$kind": "Microsoft.Test.Script",
"dialog": {
"$kind": "Microsoft.AdaptiveDialog",
"id": "planningTest",
"triggers": [
{
"$kind": "Microsoft.OnBeginDialog",
"actions": [
{
"$kind": "Microsoft.NumberInput",
"defaultLocale": "en-us",
"disabled": false,
"maxTurnCount": 2,
"alwaysPrompt": true,
"allowInterruptions": false,
"prompt": "Give me your favorite number (1-10)",
"unrecognizedPrompt": "Sorry, ${turn.activity.text} did not include a valid number.",
"invalidPrompt": "Sorry, ${this.value} does not work. Can you give me a different number that is between 1-10?",
"defaultValueResponse": "Sorry, we have tried for ${class.MaxTurnCount} number of times and I'm still not getting it. For now, I'm setting ${class.property} to ${class.DefaultValue}",
"property": "user.favoriteNumber",
"outputFormat": "=string(this.value)",
"validations": [
"=int(this.value) >=1",
"=int(this.value) <= 10"
],
"defaultValue": 9
}
]
}
],
"defaultResultProperty": "dialog.result"
},
"script": [
{
"$kind": "Microsoft.Test.UserSays",
"text": "hi"
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Give me your favorite number (1-10)"
},
{
"$kind": "Microsoft.Test.UserSays",
"text": "1000"
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Sorry, 1000 does not work. Can you give me a different number that is between 1-10?"
},
{
"$kind": "Microsoft.Test.UserSays",
"text": "25"
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Sorry, we have tried for 2 number of times and I'm still not getting it. For now, I'm setting user.favoriteNumber to 9"
}
]
}