Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Sep 1, 2025

Summary

This PR adds comprehensive test coverage for previously untested HTML BaseTypes generic classes in the FSharp.Data library, achieving 100% coverage through reflection-based testing approaches.

Coverage Improvements Achieved

  • FSharp.Data.Runtime.BaseTypes.HtmlDocument: 0% → 100% ✅
  • FSharp.Data.Runtime.BaseTypes.HtmlList: 0% → 100% ✅
  • FSharp.Data.Runtime.BaseTypes.HtmlTable: 0% → 100% ✅

Test Implementation

  • 11 comprehensive tests created in BaseTypesHtmlGenerics.fs
  • Reflection-based approach to test "generated code only" methods
  • Multiple test scenarios covering Create methods, property access, and various converter functions
  • All existing tests continue to pass (2838 tests total)

Technical Approach

The challenge was that these BaseTypes classes contain methods marked with [<CompilerMessageAttribute("This method is intended for use in generated code only.")>], which cannot be called directly. The solution uses reflection to invoke these methods and validate their functionality:

// Example reflection-based test pattern
let createMethod = typeof<HtmlDocument>.GetMethod("Create", [| typeof<bool>; typeof<System.IO.TextReader> |])
createMethod.Invoke(null, [| false; reader |]) :?> HtmlDocument

Test Coverage Details

  1. HtmlDocument: Tests document creation and method availability for GetTable, GetList, GetDefinitionList
  2. HtmlTable: Tests table creation with/without headers, property access, multiple converter types
  3. HtmlList: Tests list creation, nested lists, property access, complex converters

Quality Assurance

  • ✅ All tests pass
  • ✅ No existing functionality broken
  • ✅ Follows established testing patterns
  • ✅ Comprehensive coverage of public API surface

🤖 Generated with Claude Code

- Created 11 reflection-based tests for HtmlDocument, HtmlList<T>, and HtmlTable<T>
- Achieved 100% coverage for previously untested BaseTypes HTML generic classes
- Used reflection to access "generated code only" methods and test their functionality
- Tests cover Create methods, property access, and various converter scenarios

Coverage improvement:
- FSharp.Data.Runtime.BaseTypes.HtmlDocument: 0% → 100%
- FSharp.Data.Runtime.BaseTypes.HtmlList<T>: 0% → 100%
- FSharp.Data.Runtime.BaseTypes.HtmlTable<T>: 0% → 100%

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dsyme dsyme closed this Sep 1, 2025
@dsyme dsyme reopened this Sep 1, 2025
@dsyme dsyme merged commit 927ff6c into main Sep 1, 2025
5 checks passed
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