Skip to content

test: expand unit test coverage for ModelGenerator and previously-untested CMA/Model classes#47

Draft
OMpawar-21 wants to merge 3 commits into
enhc/betafrom
enhc/DX-9463
Draft

test: expand unit test coverage for ModelGenerator and previously-untested CMA/Model classes#47
OMpawar-21 wants to merge 3 commits into
enhc/betafrom
enhc/DX-9463

Conversation

@OMpawar-21

Copy link
Copy Markdown

Summary

  • Add unit tests for ModelGenerator.cs's code-generation logic (flipping the relevant methods to internal) and previously 0%-covered classes (ContentstackException, Config, Model/OAuth.cs, CMA/Http/*, etc.)
  • Fix a bug where CreateFile() emitted literal {nullableString()} text instead of interpolating the nullable suffix
  • Add Scripts/generate_test_report.py to turn a .trx + coverage run into a single HTML report

Line coverage: 54.9% → 74.6% overall (ModelGenerator.cs: 79.4%). Remaining gaps trace to ContentstackClient having no DI/mocking seam — out of scope here.

Test plan

  • dotnet build — 0 errors, 0 warnings
  • dotnet test — 376/376 passing
  • Verified the new regression test fails pre-fix, passes post-fix

@OMpawar-21 OMpawar-21 requested a review from reeshika-h July 8, 2026 11:54
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.

1 participant