Skip to content

Commit 8dbc194

Browse files
authored
[AI Test Tool] Fix GetNextTurn (#3324)
<!-- Thank you for submitting a Pull Request. If you're new to contributing to BCApps please read our pull request guideline below * https://github.com/microsoft/BCApps/Contributing.md --> #### Summary <!-- Provide a general summary of your changes --> Causes indexing error in multi-turn testing. Current turn should never be larger than number of turns. Otherwise GetTestInput will fail: `TestInputJson := TestInput.GetTestInput(TurnsTok).ElementAt(CurrentTurn - 1).Element(ElementName)` #### Work Item(s) <!-- Add the issue number here after the #. The issue needs to be open and approved. Submitting PRs with no linked issues or unapproved issues is highly discouraged. --> Fixes [AB#571847](https://dynamicssmb2.visualstudio.com/Dynamics%20SMB/_workitems/edit/571847)
1 parent ad16013 commit 8dbc194

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Tools/AI Test Toolkit/src/AITTestContextImpl.Codeunit.al

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ codeunit 149043 "AIT Test Context Impl."
186186
if not IsMultiTurn then
187187
exit(false);
188188

189-
if CurrentTurn > NumberOfTurns then
189+
if CurrentTurn + 1 > NumberOfTurns then
190190
exit(false);
191191

192192
CurrentTurn := CurrentTurn + 1;

0 commit comments

Comments
 (0)