.NET: Improve unit test coverage for Microsoft.Agents.AI.OpenAI#3349
Merged
rogerbarreto merged 6 commits intomainfrom Jan 22, 2026
Merged
.NET: Improve unit test coverage for Microsoft.Agents.AI.OpenAI#3349rogerbarreto merged 6 commits intomainfrom
rogerbarreto merged 6 commits intomainfrom
Conversation
Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
Member
|
@copilot Address format issues. |
Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
Copilot
AI
changed the title
.NET: [WIP] Improve unit test coverage for Microsoft.Agents.AI.OpenAI
.NET: Improve unit test coverage for Microsoft.Agents.AI.OpenAI
Jan 22, 2026
Member
|
Formatting error still persists, getting: |
Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
Contributor
Author
Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
Contributor
Author
SergeyMenshykh
approved these changes
Jan 22, 2026
This was referenced Jan 27, 2026
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
…osoft#3349) * Initial plan * Add unit tests for Microsoft.Agents.AI.OpenAI to improve code coverage Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com> * Address code review feedback: remove unused using directives Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com> * Fix format issues: file encoding and remove unused using directives Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com> * Fix redundant cast error by using named parameter Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com> * Remove excessive inline comments per PR review feedback --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
This was referenced Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Code coverage for
Microsoft.Agents.AI.OpenAIwas at 66.6% line / 50% branch coverage, which is below the required 85% target. Several internal classes had 0-50% coverage includingAsyncStreamingResponseUpdateCollectionResult(0%),StreamingUpdatePipelineResponse(13.3%),AgentResponseExtensions(50%), andAIAgentWithOpenAIExtensions(50%).Description
This PR improves unit test coverage for the Microsoft.Agents.AI.OpenAI project by adding 47 new unit tests (43 → 90 total) targeting uncovered code paths.
New test files created:
AgentResponseExtensionsTests.cs- Tests forAsOpenAIChatCompletionandAsOpenAIResponseextension methodsAsyncStreamingChatCompletionUpdateCollectionResultTests.cs- Tests for internal streaming chat completion classAsyncStreamingResponseUpdateCollectionResultTests.cs- Tests for internal streaming response classStreamingUpdatePipelineResponseTests.cs- Tests for internal pipeline response classExtended existing tests:
AIAgentWithOpenAIExtensionsTests.cs- AddedResponseItemoverloads forRunAsync/RunStreamingAsyncOpenAIAssistantClientExtensionsTests.cs- Added tool conversion paths (HostedCodeInterpreterTool,HostedFileSearchTool,HostedFileContent,HostedVectorStoreContent)Infrastructure changes:
InternalsVisibleToattribute to expose internal types to the test projectTest Results: All 90 tests passing
Contribution Checklist
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.