public void Day_Equals_Day(int year, int month, int day, int birthNumber, int checksum) { var personalIdentityNumber = new PersonalIdentityNumber(year, month, day, birthNumber, checksum); var dateOfBirth = personalIdentityNumber.GetDateOfBirthHint(); Assert.Equal(day, dateOfBirth.Day); }
private void AddPersonalIdentityNumberProperties(Dictionary <string, string> properties, Dictionary <string, double> metrics, PersonalIdentityNumber personalIdentityNumber) { if (_options.LogUserPersonalIdentityNumber) { properties.Add(PropertyName_UserSwedishPersonalIdentityNumber, personalIdentityNumber?.To12DigitString() ?? string.Empty); } if (_options.LogUserPersonalIdentityNumberHints) { properties.Add(PropertyName_UserDateOfBirthHint, personalIdentityNumber?.GetDateOfBirthHint().ToString("yyyy-MM-dd") ?? string.Empty); properties.Add(PropertyName_UserGenderHint, personalIdentityNumber?.GetGenderHint().ToString() ?? string.Empty); var ageHint = personalIdentityNumber?.GetAgeHint(); if (ageHint != null) { metrics.Add(PropertyName_UserAgeHint, ageHint.Value); } } }