Improve test coverage for JSON Runtime Helpers and BaseTypes.HtmlDocument #1581
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.
Summary
This PR systematically improves test coverage by adding comprehensive tests for two previously untested areas with 0% coverage:
• JSON Runtime Helpers (FSharp.Data.Json.Core) - Added 5 test methods covering private helper functions through public API edge case testing
• BaseTypes.HtmlDocument (FSharp.Data.Html.Core) - Added new test file with 16 test methods covering all HtmlDocument functionality
Coverage Analysis
Before
inRangeDecimal,inRangeFloat,isIntegerDecimal,isIntegerFloat)Create,Html,GetTable,GetList,GetDefinitionList)Improvements Made
JSON Runtime Helpers Testing
inRangeDecimal/inRangeFloatfunctionsisIntegerDecimal/isIntegerFloatJsonConversionsAPI using strategic edge casesBaseTypes.HtmlDocument Testing
KeyNotFoundException)includeLayoutTablestrue/false scenariosTest Details
Files Changed
tests/FSharp.Data.Core.Tests/JsonConversions.fs: Added 93 lines with 5 new test methodstests/FSharp.Data.Core.Tests/BaseTypesHtmlDocument.fs: New file with 258 lines, 16 test methodstests/FSharp.Data.Core.Tests/FSharp.Data.Core.Tests.fsproj: Added new test file to compilationTechnical Implementation
#nowarn "10001"for BaseTypes methods intended for generated codeTest Plan
✅ All tests pass: 16/16 BaseTypes.HtmlDocument tests pass
✅ JSON tests verified: 5/5 new JsonConversions tests pass with edge cases
✅ Build successful: No compilation errors or warnings
✅ Coverage collection: Updated coverage report generated successfully
Quality Assurance
Related Issues
🤖 Generated with Claude Code