Example #1
0
        public IHttpActionResult GetPorPessoa(int idPessoa)
        {
            if (idPessoa <= 0)
            {
                return(BadRequest("Informe um id vĂ¡lido"));
            }

            return(Ok(_telefoneNegocio.Listar(idPessoa)));
        }
Example #2
0
        public void DeveListarTelefonesDePessoa()
        {
            var pessoaRepository = Substitute.For <PessoaRepository>((ISession)null);

            pessoaRepository.TelefonesPorPessoa(1)
            .Returns(new List <Telefone>
            {
                new Telefone
                {
                    Id = 1
                }
            });


            var telefoneNegocio = new TelefoneNegocio(pessoaRepository, Mapper.Instance);
            var retorno         = telefoneNegocio.Listar(1);

            Assert.That(retorno.Count, Is.EqualTo(1));
        }