Uh oh!
There was an error while loading. Please reload this page.
.NET: Improve unit test coverage for Microsoft.Agents.AI.AzureAI.Persistent - #3384
Conversation
…rsistent Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
Roger Barreto (rogerbarreto)
commented
Jan 23, 2026
Format issues happening below. |
Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR significantly improves unit test coverage for the Microsoft.Agents.AI.AzureAI.Persistent namespace, targeting the PersistentAgentsClientExtensions class. The PR successfully increases coverage from 59.2% to 97.9% line rate and 97.45% branch rate by adding comprehensive tests for previously uncovered code paths.
Changes:
- Added 25 new test methods covering various overloads of AsAIAgent, GetAIAgentAsync, and CreateAIAgentAsync methods
- Added comprehensive tests for the ConvertAIToolsToToolDefinitions private method by testing CreateAIAgentAsync with different tool types
- Added tests for null parameter validation, instructions handling, clientFactory application, and services propagation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
AsAIAgentoverload withChatOptionsConvertAIToolsToToolDefinitionsprivate method viaCreateAIAgentAsyncHostedCodeInterpreterToolhandlingHostedCodeInterpreterToolwithHostedFileContentinputsHostedFileSearchToolhandlingHostedFileSearchToolwithHostedVectorStoreContentinputsHostedWebSearchToolhandling with connectionIdHostedWebSearchToolwithout connectionId (falls to default)GetAIAgentAsyncandCreateAIAgentAsyncwith optionsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.