コード例 #1
0
        public void ObterIdadeTest()
        {
            DateTime dataNascimento = new DateTime(1992, 1, 7);
            int      retorno        = pessoaBusiness.ObterIdade(dataNascimento);

            Assert.AreEqual(27, retorno);
        }
コード例 #2
0
        public int ObterPontuacao(Familia familia)
        {
            var pretendente        = familiaBusiness.ObterPretendente(familia);
            int idadeDoPretendente = pessoaBusiness.ObterIdade(pretendente.DataDeNascimento);

            if (idadeDoPretendente < 30)
            {
                return(UmPonto);
            }

            else if (idadeDoPretendente <= 44)
            {
                return(DoisPontos);
            }

            return(TresPontos);
        }