Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sw-joelmut committed Apr 18, 2024
1 parent 2e46232 commit 324a581
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
Original file line number Diff line number Diff line change
@@ -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."
}
]
}
Original file line number Diff line number Diff line change
@@ -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."
}
]
}

0 comments on commit 324a581

Please sign in to comment.