-
Notifications
You must be signed in to change notification settings - Fork 1.1k
.NET: Improve unit test coverage for Microsoft.Agents.AI.AzureAI.Persistent #3384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…rsistent Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
|
Format issues happening below. |
Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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.