Exemplo n.º 1
0
        public void CalculateAge_GivenItsMyThirdBirthday_ShouldReturn3()
        {
            //Arrange

            var itsMyThirdBirthday = new DateTime(1993, 09, 12);
            var dob = new DateTime(1990, 09, 12);

            //Act

            var age = Age.CalculateAge(dob, itsMyThirdBirthday);

            //Assert

            Assert.AreEqual(age, 3);
        }
Exemplo n.º 2
0
        private static int GetAge(DateTime dob, DateTime currentDateTime)
        {
            var age = Age.CalculateAge(dob, currentDateTime);

            return(age);
        }