-
Notifications
You must be signed in to change notification settings - Fork 645
.NET: Add comprehensive unit tests for Microsoft.Agents.AI.AzureAIAgents extension methods #1786
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
.NET: Add comprehensive unit tests for Microsoft.Agents.AI.AzureAIAgents extension methods #1786
Conversation
…ents Co-authored-by: rogerbarreto <[email protected]>
Co-authored-by: rogerbarreto <[email protected]>
Co-authored-by: rogerbarreto <[email protected]>
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 adds unit test coverage for the AgentsClientExtensions class and fixes a bug in the GetAIAgent methods where the .Value property was missing when accessing ClientResult objects. Additionally, it updates the Azure.AI.Agents.Persistent package version from 1.2.0-beta.6 to 1.2.0-beta.7.
- Adds comprehensive unit tests for all
AgentsClientExtensionsmethods - Fixes bug where
.Valueproperty was not accessed onClientResultreturn values - Updates Azure.AI.Agents.Persistent package version
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/tests/Microsoft.Agents.AI.AzureAIAgents.UnitTests/Microsoft.Agents.AI.AzureAIAgents.UnitTests.csproj | Creates new test project for AzureAIAgents unit tests |
| dotnet/tests/Microsoft.Agents.AI.AzureAIAgents.UnitTests/AgentsClientExtensionsTests.cs | Adds comprehensive unit tests covering all extension methods with parameter validation and functionality tests |
| dotnet/src/Microsoft.Agents.AI.AzureAIAgents/AgentsClientExtensions.cs | Fixes bug by adding .Value to access the actual value from ClientResult objects in GetAIAgent methods |
| dotnet/agent-framework-dotnet.slnx | Adds the new test project to the solution |
| dotnet/Directory.Packages.props | Updates Azure.AI.Agents.Persistent package version |
dotnet/tests/Microsoft.Agents.AI.AzureAIAgents.UnitTests/AgentsClientExtensionsTests.cs
Outdated
Show resolved
Hide resolved
dotnet/tests/Microsoft.Agents.AI.AzureAIAgents.UnitTests/AgentsClientExtensionsTests.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
Created unit test project covering all extension methods in
AgentsClientExtensions.csfor theMicrosoft.Agents.AI.AzureAIAgentspackage.Test Project Structure
dotnet/tests/Microsoft.Agents.AI.AzureAIAgents.UnitTests/Microsoft.Agents.AI.AzureAI.UnitTests,Microsoft.Agents.AI.OpenAI.UnitTests)Test Coverage (30+ tests)
Implementation Notes
Tests use Moq to mock
AgentsClientand related types, testing extension method logic without service calls. Helper methods create test fixtures forAgentRecord,AgentVersion, andAgentDefinition.Build Requirement
Requires
Azure.AI.Agents(v2.0.0-alpha.20251024.3) from Azure DevOps private feed. Tests compile and run in CI/CD with proper Azure Artifacts authentication. See project README for setup details.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.