This commit is contained in:
Joel Mut 2024-04-18 09:22:50 -03:00
Родитель 2e462328af
Коммит 324a581564
3 изменённых файлов: 165 добавлений и 0 удалений

Просмотреть файл

@ -44,4 +44,12 @@ describe('ConditionalsTests', function () {
it('OnRepromptDialog', async function () {
await TestUtils.runTestScript(resourceExplorer, 'ConditionalsTests_OnRepromptDialog');
});
it('OnError loop limit', async function () {
await TestUtils.runTestScript(resourceExplorer, 'ConditionalsTests_OnErrorLoop');
});
it('OnError default loop limit', async function () {
await TestUtils.runTestScript(resourceExplorer, 'ConditionalsTests_OnErrorLoopDefaultLimit');
});
});

Просмотреть файл

@ -0,0 +1,65 @@
{
"$schema": "../../../tests.schema",
"$kind": "Microsoft.Test.Script",
"dialog": {
"$kind": "Microsoft.AdaptiveDialog",
"id": "ErrorLoop",
"autoEndDialog": true,
"defaultResultProperty": "dialog.result",
"triggers": [
{
"$kind": "Microsoft.OnBeginDialog",
"actions": [
{
"$kind": "Microsoft.SendActivity",
"activity": "Throw Exception in BeginDialog."
},
{
"$kind": "Microsoft.ThrowException",
"errorValue": "Exception in BeginDialog."
}
]
},
{
"$kind": "Microsoft.OnError",
"actions": [
{
"$kind": "Microsoft.SendActivity",
"activity": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.ThrowException",
"errorValue": "Exception in OnError."
}
],
"executionLimit": 3
}
]
},
"script": [
{
"$kind": "Microsoft.Test.UserSays",
"text": "hi"
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in BeginDialog."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Exception in OnError."
}
]
}

Просмотреть файл

@ -0,0 +1,92 @@
{
"$schema": "../../../tests.schema",
"$kind": "Microsoft.Test.Script",
"dialog": {
"$kind": "Microsoft.AdaptiveDialog",
"id": "ErrorLoop",
"autoEndDialog": true,
"defaultResultProperty": "dialog.result",
"triggers": [
{
"$kind": "Microsoft.OnBeginDialog",
"actions": [
{
"$kind": "Microsoft.SendActivity",
"activity": "Throw Exception in BeginDialog."
},
{
"$kind": "Microsoft.ThrowException",
"errorValue": "Exception in BeginDialog."
}
]
},
{
"$kind": "Microsoft.OnError",
"actions": [
{
"$kind": "Microsoft.SendActivity",
"activity": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.ThrowException",
"errorValue": "Exception in OnError."
}
]
}
]
},
"script": [
{
"$kind": "Microsoft.Test.UserSays",
"text": "hi"
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in BeginDialog."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Throw Exception in OnError."
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Exception in OnError."
}
]
}