public void Deve_Tratar_Exception_Ao_Salvar_Uma_Chamada()
        {
            var mockAplicacao = new Mock<IAplicacao<Dominio.Chamada.Chamada>>();
            mockAplicacao.Setup(x => x.Salvar(It.IsAny<Dominio.Chamada.Chamada>()))
                .Throws(new Exception("erro interno do servidor"));

            var controller = new ChamadaController(mockAplicacao.Object);

            var result = controller.Salvar(new Dominio.Chamada.Chamada());

            Assert.AreEqual("erro interno do servidor", result.Data.GetType().GetProperty("erro").GetValue(result.Data));
        }
        public void Deve_Salvar_Um_Chamado()
        {
            var mockAplicacao = new Mock<IAplicacao<Dominio.Chamada.Chamada>>();
            mockAplicacao.Setup(x => x.Salvar(It.IsAny<Dominio.Chamada.Chamada>()))
                .Returns(new Dominio.Chamada.Chamada {Codigo = 34});

            var controller = new ChamadaController(mockAplicacao.Object);

            var result = controller.Salvar(new Dominio.Chamada.Chamada());

            Assert.AreEqual(34, ((Dominio.Chamada.Chamada) result.Data).Codigo);
        }