-
-
Notifications
You must be signed in to change notification settings - Fork 23
Random.GenerateAsOutputWithType #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #83 +/- ##
==========================================
+ Coverage 47.27% 57.26% +9.99%
==========================================
Files 44 46 +2
Lines 2913 3075 +162
Branches 411 438 +27
==========================================
+ Hits 1377 1761 +384
+ Misses 1412 1180 -232
- Partials 124 134 +10 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
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 adds functionality for generating random values along with type information via the new Random.GenerateAsOutputWithType helper, ensuring backwards compatibility with WireMock.Net. Key changes include:
- Adding new unit tests to verify output type serialization and deserialization for various random value types.
- Integrating a "KeepType" flag to control whether the generated value is wrapped with type information.
- Updating helper implementations and JSON utilities to support the new output wrapper.
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/Handlebars.Net.Helpers.Tests/Templates/RandomHelpersTemplateTests.cs | Added multiple tests for random generation indicating expected types and ranges using OutputWithType. |
| test/Handlebars.Net.Helpers.Tests/Models/OutputWithTypeTests.cs | Expanded tests for deserialization and conversion behavior of OutputWithType. |
| test/Handlebars.Net.Helpers.Tests/Helpers/RandomHelpersTests.cs | Added tests for missing type argument and verifying generation with output type. |
| src/Handlebars.Net.Helpers/Models/OutputWithType.cs | Implemented serialization/deserialization and type conversion logic for wrapping random values. |
| src/Handlebars.Net.Helpers/HandlebarsHelpers.cs | Updated helper registration to output wrapped type data when requested. |
| src/Handlebars.Net.Helpers.Random/Helpers/RandomHelpers.cs | Introduced new helpers (RandomKeepType, GenerateAsOutputWithType) and refactored value generation logic. |
| src/Handlebars.Net.Helpers.Core/Utils/SimpleJsonUtils.cs | Created a simple JSON utility wrapper for serialization and deserialization. |
Files not reviewed (2)
- src/Handlebars.Net.Helpers.Core/Handlebars.Net.Helpers.Core.csproj: Language not supported
- src/Handlebars.Net.Helpers.Random/Handlebars.Net.Helpers.Random.csproj: Language not supported
No description provided.