Add unit tests
This commit is contained in:
Родитель
2e462328af
Коммит
324a581564
|
@ -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."
|
||||
}
|
||||
]
|
||||
}
|
Загрузка…
Ссылка в новой задаче