Add missing Spector scenario test coverage for C# emitter#9962
Merged
Conversation
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement missing spector scenarios for C# emitter
Add missing Spector scenario test coverage for C# emitter
Mar 7, 2026
Contributor
|
@copilot merge from main. |
…sing-spector-scenarios
Contributor
Author
Merged from main and scoped the PR to only the XML, Special Words, and Additional Properties specs. Removed the Routes and Multipart tests that require design work. Merge conflict in XmlTests.cs resolved (kept both main's new Enum/Datetime tests and our GetXmlErrorValue test). Commit: 1f7f197. |
commit: |
jorgerangel-msft
approved these changes
Mar 24, 2026
msyyc
pushed a commit
that referenced
this pull request
Apr 1, 2026
Several Spector scenarios had no corresponding NUnit test methods in the C# emitter test suite, leaving coverage gaps that would go undetected. Scoped to XML, Special Words, and Additional Properties specs only — other gaps (Routes, Multipart) require design work. ## New tests added (5 total) ### `SpecialWords` — ModelProperties (2) - `ModelProperties_DictMethodsAsync` — dict method names as model properties - `ModelProperties_WithListAsync` — `list` as a model property name ### `Payload/Xml` (1) - `GetXmlErrorValue` — verifies a `ClientResultException` with status 400 on the error endpoint ### `Type/Property/AdditionalProperties` (2) - `SpreadRecordNonDiscriminatedUnion3Get/Put` — additional properties typed as `WidgetData2[] | WidgetData1`; get-side parses the JSON array via `JsonDocument`, put-side writes the array as raw `BinaryData` <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Implement missing spector scenarios for csharp emitter</issue_title> > <issue_description></issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #9961 <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
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.
Several Spector scenarios had no corresponding NUnit test methods in the C# emitter test suite, leaving coverage gaps that would go undetected. Scoped to XML, Special Words, and Additional Properties specs only — other gaps (Routes, Multipart) require design work.
New tests added (5 total)
SpecialWords— ModelProperties (2)ModelProperties_DictMethodsAsync— dict method names as model propertiesModelProperties_WithListAsync—listas a model property namePayload/Xml(1)GetXmlErrorValue— verifies aClientResultExceptionwith status 400 on the error endpointType/Property/AdditionalProperties(2)SpreadRecordNonDiscriminatedUnion3Get/Put— additional properties typed asWidgetData2[] | WidgetData1; get-side parses the JSON array viaJsonDocument, put-side writes the array as rawBinaryDataOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.