예제 #1
0
        public void GetAgeNowForBirthdayToday()
        {
            var birthday = new DateTime(1970, 3, 5);
            var today = new DateTime(2000, 3, 5);
            var age = birthday.GetAge(today);

            Assert.Equal(30, age);
        }
예제 #2
0
        public void GetAgeWithTodaySpecifiedForBirthdayYesterdayPriorMonth()
        {
            var birthday = new DateTime(1990, 9, 30);
            var today = new DateTime(2011, 10, 1);
            var age = birthday.GetAge(today);

            Assert.Equal(21, age);
        }
예제 #3
0
        public void GetAgeWithTodaySpecifiedForBirthdayYesterdayPriorYear()
        {
            var today = new DateTime(2020, 12, 31);
            var birthday = new DateTime(1994, 1, 1);
            var age = birthday.GetAge(today);

            Assert.Equal(26, age);
        }
예제 #4
0
        public void GetAgeWithTodaySpecifiedForBirthdayYesterdaySameMonth()
        {
            var birthday = new DateTime(1968, 3, 5);
            var today = new DateTime(2000, 3, 5);
            var age = birthday.GetAge(today);

            Assert.Equal(32, age);
        }
예제 #5
0
        public void GetAgeWithTodaySpecifiedForBirthdayTomorrowNextYear()
        {
            var today = new DateTime(2011, 1, 1);
            var birthday = new DateTime(2000, 12, 31);
            var age = birthday.GetAge(today);

            Assert.Equal(10, age);
        }
        public void GetAgeWithTodaySpecifiedForBirthdayTomorrowNextMonth()
        {
            var today = new DateTime(2011, 8, 31);
            var birthday = new DateTime(2000, 9, 1);
            var age = birthday.GetAge(today);

            Assert.AreEqual(10, age);
        }
        public void GetAgeWithTodaySpecifiedForBirthdayToday()
        {
            var birthday = new DateTime(1970, 3, 5);
            var today = new DateTime(2000, 3, 5);
            var age = birthday.GetAge(today);

            Assert.AreEqual(30, age);
        }
        public void GetAgeNowForBirthdayTomorrow()
        {
            var birthday = new DateTime(1970, 3, 6);
            var today = new DateTime(2000, 3, 5);
            var age = birthday.GetAge(today);

            Assert.AreEqual(29, age);
        }
예제 #9
0
        public void GetAgeWithTodaySpecifiedForBirthdayTomorrowSameMonth()
        {
            var today = new DateTime(2011, 3, 6);
            var birthday = new DateTime(1994, 3, 7);

            var age = birthday.GetAge(today);

            Assert.Equal(16, age);
        }