Skip to content

Fix source generated proxy suitability testing - #1336

Merged
Andrew Arnott (AArnott) merged 2 commits into
mainfrom
dev/andarno/fixes
Oct 25, 2025
Merged

Fix source generated proxy suitability testing#1336
Andrew Arnott (AArnott) merged 2 commits into
mainfrom
dev/andarno/fixes

Conversation

@AArnott

@AArnottAndrew Arnott (AArnott) commented Oct 25, 2025

Copy link
Copy Markdown
Member

Fix issues that only show up when the interceptor is not used

This enables a bunch of tests that were previously not running when the interceptor is suppressed. Once we run them in that context, many of them were failing. I fix those bugs here.

This enables a bunch of tests that were previously not running when the interceptor is suppressed. Once we run them in that context, many of them were failing. I fix those bugs here.

CopilotAI left a comment

Copy link
Copy Markdown

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 fixes the testing of source-generated proxy suitability by correcting preprocessor directive placement and improving the logic for validating that proxies implement the correct set of interfaces.

  • Reorganized preprocessor directives in test file to properly exclude source-generated tests when interceptors are not available
  • Fixed interface validation logic to deduplicate required interfaces and properly check for assignability
  • Removed trailing period from error message for consistency

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

FileDescription
test/StreamJsonRpc.Tests/JsonRpcProxyGenerationTests.csCorrected #if directive placement to properly scope the SourceGenerated test class when interceptors are unavailable
src/StreamJsonRpc/Reflection/ProxyInputs.csRemoved trailing period from Requirements property string
src/StreamJsonRpc/Reflection/ProxyBase.csEnhanced proxy interface validation by deduplicating required interfaces and fixing the assignability check logic

Comment threadsrc/StreamJsonRpc/Reflection/ProxyBase.cs
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@AArnott@matteo-prosperi