You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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?
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.
The text was updated successfully, but these errors were encountered: