Skip to content

Add missing Spector scenario test coverage for C# emitter#9962

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/implement-missing-spector-scenarios
Draft

Add missing Spector scenario test coverage for C# emitter#9962
Copilot wants to merge 3 commits intomainfrom
copilot/implement-missing-spector-scenarios

Conversation

Copy link
Contributor

Copilot AI commented Mar 7, 2026

Several Spector scenarios had no corresponding NUnit test methods in the C# emitter test suite, leaving coverage gaps that would go undetected.

New tests added (31 total)

SpecialWords — ModelProperties (2)

  • ModelProperties_DictMethodsAsync — dict method names as model properties
  • ModelProperties_WithListAsynclist as a model property name

Payload/Multipart — FormData (5)

  • WithWireName — multipart body with wire name mappings
  • OptionalParts — optional fields; sends 3 requests (id-only, image-only, both)
  • FileUploadFileSpecificContentType, FileUploadFileRequiredFilename, FileUploadFileArrayFormDataFile sub-client scenarios

Routes/PathParameters — Expansion types (18)

Added Standard + Explode × {primitive, array, record} for each of:

  • SimpleExpansion, PathExpansion, MatrixExpansion

Routes/QueryParameters — QueryContinuation Explode (3)

  • QueryContinuationExplodePrimitive/Array/Record — marked [Ignore] consistent with existing QueryContinuation Standard tests (typespec/issues/5139)

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
Original prompt

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)


💡 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.

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Mar 7, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement missing spector scenarios for csharp emitter

2 participants