Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add asLocalDate for java.util.Date #1285

Closed
8 tasks
robstoll opened this issue Dec 29, 2022 · 4 comments · Fixed by #1308
Closed
8 tasks

add asLocalDate for java.util.Date #1285

robstoll opened this issue Dec 29, 2022 · 4 comments · Fixed by #1308
Assignees
Labels
Milestone

Comments

@robstoll
Copy link
Owner

robstoll commented Dec 29, 2022

Platform (all, jvm, js): jvm
Extension (none, kotlin 1.3): none

Code related feature

expect(Date()).asLocalDate().toBeAfter(...)

//instead of

expect(Date().toInstant().atZone(ZoneId.systemDefault()).toLocalDate()).toBeAfter(...);

Following the things you need to do:

api-fluent

  • provide a val which returns Expect<LocalDate> in dateSubjectChangers.kt (see fileSubjectChangers.kt as a guideline)
  • provide a fun which expects an assertionCreator-lambda and returns Expect<Date> in dateSubjectChangers.kt (see fileSubjectChangers.kt as a guideline)
  • add @since 0.19.0 (adapt to current milestone) to KDOC
  • extend or write a separate Spec named DateAsLocalDateExpectationsSpec in specs -> jvmMain (see for instance FileAsPathExpectationsSpec) and extend it in atrium-api-fluent-en_GB -> jvmTest

api-infix

  • provide a val which returns Expect<Date> in dateSubjectChangers.kt(see fileSubjectChangers.kt as a guideline)
  • provide a fun which expects an assertionCreator-lambda and returns Expect<AB> in dateSubjectChangers.kt (see fileSubjectChangers.kt as a guideline)
  • add @since 0.19.0 (adapt to current milestone) to KDOC
  • extend or write a separate Spec named DateAsLocalDateExpectationsSpec in specs -> commonMain (see for instance FileAsPathExpectationsSpec) and extend it in atrium-api-infix-en_GB -> jvmTest

Your first contribution?

  • Write a comment I'll work on this if you would like to take this issue over.
    This way we get the chance to revise the description in case things have changed in the meantime, we might give you additional hints and we can assign the task to you, so that others do not start as well.
  • See Your first code contribution for guidelines.
  • Do not hesitate to ask questions here or to contact us via Atrium's slack channel if you need help
    (Invite yourself in case you do not have an account yet).
@sajalverma17
Copy link
Contributor

@robstoll Is it okay if I work on this?

@robstoll
Copy link
Owner Author

Sure, go for it 👍

@sajalverma17
Copy link
Contributor

@robstoll I made a typo in the branch name 😅, I hope that isn't a big problem, I'll delete the branch after merge.
Anyway, I've opened a PR as I think my changes are ready for review.

@robstoll
Copy link
Owner Author

no worries, doesn't bother me 😁

@robstoll robstoll added this to the 0.19.0 milestone Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants