fix: DatetimeChunkDecoder bug fix + test coverage ~98%#60
Merged
Conversation
…o ~98% - Fix ArgumentOutOfRangeException in DatetimeChunkDecoder when day exceeds days in resolved month (e.g., day 31 in April after month rollback) - Use DateTime.UtcNow instead of DateTime.Now for consistency - Add 67 new tests (354 → 421 total), all passing - Line coverage: 94.8% → 97.8% - Branch coverage: 92.3% → 94.7% - Method coverage: 93.8% → 98.6% New test files: - PresentWeatherTest (0% → 100%) - MetarExceptionExtendedTest (53.5% → 82.1%) - TafExceptionExtendedTest (32.1% → 82.1%) - ValueExtendedTest for Metar and Taf (98.4% → 100%) - ForecastPeriodTest (90.9% → 100%) - DecodedMetarExtendedTest - TafChunkDecoderBaseTest (90.4% → 100%) Updated README.md and CHANGELOG.md with coverage improvements. Co-Authored-By: Afonso Dutra Nogueira Filho <afonsoft@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Owner
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
afonsoft
approved these changes
May 4, 2026
|
| { | ||
| var result = Value.ToInt("1234"); | ||
| ClassicAssert.IsNotNull(result); | ||
| ClassicAssert.AreEqual(1234, result.Value); |
| { | ||
| var result = Value.ToInt("M05"); | ||
| ClassicAssert.IsNotNull(result); | ||
| ClassicAssert.AreEqual(-5, result.Value); |
| { | ||
| var result = Value.ToInt("P10"); | ||
| ClassicAssert.IsNotNull(result); | ||
| ClassicAssert.AreEqual(10, result.Value); |
| { | ||
| var result = Value.ToInt("1234"); | ||
| ClassicAssert.IsNotNull(result); | ||
| ClassicAssert.AreEqual(1234, result.Value); |
| { | ||
| var result = Value.ToInt("M05"); | ||
| ClassicAssert.IsNotNull(result); | ||
| ClassicAssert.AreEqual(-5, result.Value); |
| { | ||
| var result = Value.ToInt("P10"); | ||
| ClassicAssert.IsNotNull(result); | ||
| ClassicAssert.AreEqual(10, result.Value); |
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.



All Submissions:
Changes to Core Features:
Resumo / Summary
🐛 Bug Fix: DatetimeChunkDecoder
Correção de
ArgumentOutOfRangeExceptionnoDatetimeChunkDecoder(tanto Metar quanto Taf) quando o dia do relatório excede os dias do mês resolvido após rollback de mês.Exemplo: Dia 31 em maio (dia atual = 4) → rollback para abril (30 dias) → crash ao criar
DateTime(2026, 4, 31, ...).Solução: Clamping do dia ao máximo de dias do mês resolvido + uso de
DateTime.UtcNowpara consistência.🧪 Novos Testes (+67 testes, 354 → 421 total)
📊 Cobertura Geral
📝 Documentação
Link to Devin session: https://app.devin.ai/sessions/4bcf653aff664bf3bd2d6a36f02e48e6
Requested by: @afonsoft