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 tests for InvididualIdentityNumber #111

Open
viktorvan opened this issue Nov 24, 2019 · 1 comment
Open

Add tests for InvididualIdentityNumber #111

viktorvan opened this issue Nov 24, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@viktorvan
Copy link
Collaborator

Right now all the unit tests are at the level of SwedishPersonalIdentityNumber and SwedishCoordinationNumber. I think we have full coverage of the parsing/validation-logic from there, but we should add just a few tests for the IndividualIdentityNumber wrapper as well.

@viktorvan viktorvan added the enhancement New feature or request label Nov 24, 2019
@PeterOrneholm PeterOrneholm added this to the 3.0.0 milestone May 1, 2020
@viktorvan viktorvan self-assigned this May 6, 2020
@viktorvan
Copy link
Collaborator Author

I am struggling a bit with adding these tests. In most cases I just what to verify that IndividualIdentityNumbers calls the corresponding functions for PersonalIdentityNumber or CoordinationNumber.

One approach is to duplicate all tests for PersonalIdentityNumbers and CoordinationNumbers, and run the through the IndividualIdentityNumber api. But this means we double the amount of tests we need to maintain. And any change to Pin- or CoordNum-tests must be fixed for IndividualIdentityNumber-tests as well.
There could be some way to parameterize the tests but I don't think it would make for very readable code.

So my idea is to just add some "smoke tests" that shows that if we can parse 1 PersonalIdentityNumber, and 1 Coordination number as an IndividualIdentityNumber, then we assume everything is hooked up correctly. Since we have extensive tests for Pins and CoordNums I do not want to repeat that logic in the tests for the IndividualIdentityNumbers.

Thoughts on this @PeterOrneholm, or maybe there is an better idea that I just haven't thought of?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants