[CSharp] Add ExampleMockValueBuilder for test/sample generation (M1)#10376
Open
radhgupta wants to merge 1 commit intomicrosoft:mainfrom
Open
[CSharp] Add ExampleMockValueBuilder for test/sample generation (M1)#10376radhgupta wants to merge 1 commit intomicrosoft:mainfrom
radhgupta wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
commit: |
Contributor
|
No changes needing a change description found. |
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.
This pull request introduces a new utility class,
ExampleMockValueBuilder, to the codebase. This class provides functionality for generating mockInputOperationExampleinstances for operations that lack explicit examples in the specification. The builder covers a wide range of parameter and type scenarios, ensuring comprehensive and realistic mock data for testing or documentation purposes.New mock example generation utilities:
ExampleMockValueBuilderclass inMicrosoft.TypeSpec.Generator.Samplesnamespace, which generates mock examples for operations without provided examples, supporting both "ShortVersion" (required parameters only) and "AllParameters" (all parameters) variants.Design doc
https://gist.github.com/radhgupta/9fee69190f1ac2252a88dd88f99de327
This is M1 of the test/sample generation milestones. Next: M2 (Expression Converter).