Reduce ModelReader code duplication and add unit tests#27
Merged
StreckerCM merged 1 commit intopreviewfrom Feb 4, 2026
Merged
Conversation
Issue #9: Extracted common COF coefficient parsing into ParseCOFCoefficients() - Eliminated duplicate code between EMM and standard COF parsing - Added spherical harmonic validation (degree >= 1, order between 0 and degree) - Fixed file header comment (FileReader.cs → ModelReader.cs) Issue #12: Added comprehensive unit tests for ModelReader - Tests for WMM2015, WMM2020, WMM2025, WMMHR file parsing - Tests for error handling (null path, file not found, unsupported type) - Tests for coefficient validation and model structure - Tests for CheckStringForModel extension method - Tests for spherical harmonic validation All 57 tests pass (56 pass, 1 skipped for missing DAT file). Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
ModelReader.csby extracting common COF coefficient parsing logicChanges
Code Refactoring (Issue #9)
ParseCOFCoefficients()method to eliminate 50 lines of duplicate code between EMM and standard COF parsingUnit Tests (Issue #12)
Added 14 new tests covering:
CheckStringForModelextension methodTest Results
All 57 tests pass (56 pass, 1 skipped for missing DAT file in test data).
Test Plan
Closes #9
Closes #12
🤖 Generated with Claude Code