Skip to content

single test that may reveal a few things#2

Open
jarektkaczyk wants to merge 2 commits into
vthaing:masterfrom
jarektkaczyk:feature/tests
Open

single test that may reveal a few things#2
jarektkaczyk wants to merge 2 commits into
vthaing:masterfrom
jarektkaczyk:feature/tests

Conversation

@jarektkaczyk
Copy link
Copy Markdown

tests are not optional

[$loan1, '2020-07-15'],
[$loan2, '2020-09-30'],

// judging by the name WeeklyRepayment, probably this should be the implementation:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The meaning of WeeklyRepayment->getEndDate is Get the date that loan will be end.. It doesn't mean: Get the date of next repayment date.
I think we don't need to implement your commented code.
BTW: Sorry for confusing. I should name WeeklyRepayment->getEndDate as WeeklyRepayment->getEndDateOfLoan. It's more clear. :D

return [
// judging by the code, this should be passing:
[$loan1, '2020-07-15'],
[$loan2, '2020-09-30'],
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I used pure PHP function in this case and I trusted in it
  • Pure PHP doesn't cover the case: the date is at the end of the month and the total days of some months are different.
    --> I will modify the code and cover above case

@vthaing
Copy link
Copy Markdown
Owner

vthaing commented May 30, 2020

tests are not optional

Hi @jarektkaczyk, Thank you for your PR.

  • I'll start writing the unit test on Monday (2020-06-01).
  • I will try to finish it ASAP. I can give you the latest source code at the end of (2020-06-1). Is it ok with this plan?

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.

2 participants