Skip to content

test(integration): add DateOnly and TimeOnly round-trip integration tests#109

Merged
j-d-ha merged 2 commits into
mainfrom
fix/dateonly-and-timeonly-not-working-as-expected
Apr 19, 2026
Merged

test(integration): add DateOnly and TimeOnly round-trip integration tests#109
j-d-ha merged 2 commits into
mainfrom
fix/dateonly-and-timeonly-not-working-as-expected

Conversation

@j-d-ha
Copy link
Copy Markdown
Collaborator

@j-d-ha j-d-ha commented Apr 19, 2026

🚀 Pull Request

📋 Summary

Adds end-to-end round-trip integration tests for DateOnly and TimeOnly mapping through the generated mapper. Previously only extension-method-level round-trips (in runtime unit tests) and snapshot tests (verifying generated code shape) existed — there were no tests that exercised ToItemFromItem correctness for these types.

Covers:

  • Scalar DateOnly / TimeOnly round-trips with default format
  • Nullable variants (non-null and null)
  • List<DateOnly> / List<TimeOnly> round-trips
  • Custom mapper-level format (DateOnlyFormat, TimeOnlyFormat) round-trips
  • Assertion that the stored S attribute value matches the expected format string

✅ Checklist

  • My changes build cleanly
  • I've added/updated relevant tests
  • I've added/updated documentation or README
  • I've followed the coding style for this project
  • I've tested the changes locally (if applicable)

🧪 Related Issues or PRs

Related to #106 (feat: add native DateOnly and TimeOnly support)


💬 Notes for Reviewers

All 12 new tests pass across all target frameworks. The #if NET8_0_OR_GREATER guard mirrors the existing runtime test convention since DateOnly/TimeOnly are not available on older targets.

j-d-ha added 2 commits April 19, 2026 10:28
…mapping

- Introduced tests to verify `ToItem` and `FromItem` methods for `DateOnly` and `TimeOnly` models.
- Ensured round-trip preservation for both nullable and non-nullable properties.
- Verified custom date and time format support using `DateOnlyTimeOnlyCustomFormatModel`.
- Added list support tests for `DateOnly` and `TimeOnly` collections.
- Cleanup: removed `VersionPrefix` from `Directory.Build.props` as it is no longer required.
@github-actions github-actions Bot added the type: test Test changes label Apr 19, 2026
@j-d-ha j-d-ha merged commit b034220 into main Apr 19, 2026
4 checks passed
@j-d-ha j-d-ha deleted the fix/dateonly-and-timeonly-not-working-as-expected branch April 19, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: test Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant