Example #1
0
        public void Age(string birthDateString, string fromDateString, int expected)
        {
            DateTime birthDate = DateTime.ParseExact(birthDateString, "yyyy-MM-dd", CultureInfo.InvariantCulture);
            DateTime fromDate  = DateTime.ParseExact(fromDateString, "yyyy-MM-dd", CultureInfo.InvariantCulture);

            Assert.Equal(expected, Calculate.AgeInYears(birthDate, fromDate));
        }