Add tests for allowances
Next step is to add unit tests to the allowances branch.
In RStudio, under the Git tab click where it says todays-date and click allowances from the drop-down menu. This 'checks out' the allowances branch.
I've added some functions like youth_allowance. Please add tests for these. Use http://guides.dss.gov.au/guide-social-security-law/5 to work out what the unit test expectations should be.
A few functions are currently returning wrong results. Fix any you find, but the priority is to establish the tests. That is, it's better to record what the right answer should be first and then try to amend the functions than attempting to curate an error-free test suite.
Getting started on youth_allowance now. Is there any preference for if_else() over if(){...}else(){...}? I find the second way much easier to understand and edit.
There’s a big difference: the latter can’t be used on vectors. Consider if_else(1:5 > 3, 1, 11). They’re almost never interchangeable. On Fri, 29 Jun 2018 at 10:25 am, Matthew Katzen [email protected] wrote:
Getting started on youth_allowance now. Is there any preference for if_else() over if(){...}else(){...}? I find the second way much easier to understand and edit.
— You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/HughParsonage/grattan/issues/98#issuecomment-401211821, or mute the thread https://github.com/notifications/unsubscribe-auth/AHvGDD4pIOCpePjltykx_poh3nyfcVTXks5uBXQSgaJpZM4U7oV0 .
OK. I can see how that would be helpful if you wanted to pass multiple individuals through the function at once.