Skip to content

Conversation

@StefH
Copy link
Collaborator

@StefH StefH commented Aug 29, 2023

No description provided.

@StefH StefH changed the title Stef output with type Random.GenerateAsOutputWithType Aug 29, 2023
@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Attention: Patch coverage is 92.00000% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 57.26%. Comparing base (5046bab) to head (40151ea).

Files Patch % Lines
...rc/Handlebars.Net.Helpers/Models/OutputWithType.cs 94.53% 3 Missing and 4 partials ⚠️
...lebars.Net.Helpers.Random/Helpers/RandomHelpers.cs 88.57% 2 Missing and 2 partials ⚠️
src/Handlebars.Net.Helpers/HandlebarsHelpers.cs 50.00% 0 Missing and 3 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

@StefH StefH requested a review from Copilot April 3, 2025 17:09
Copy link

Copilot AI left a 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

Sign up for free to 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.

2 participants