Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ceciliaavila committed Apr 18, 2024
1 parent a080c90 commit 552bfae
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ public async Task ConditionalsTests_OnChooseIntent()
await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
}

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

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

[Fact]
public void OnConditionWithCondition()
{
Expand Down
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 552bfae

Please sign in to comment.