Exemple #1
0
        // GET: ListaPacientes
        public ActionResult Index()
        {
            try
            {
                IEnumerable <PacienteDto> pacientes          = _pacienteService.GetAll();
                List <PacienteViewModel>  pacientesViewModel = pacientes.Select(x => x.DtoToViewModel()).ToList();
                return(View(pacientesViewModel));
            }
            catch (Exception ex)
            {
                _log.Error($"[Method: Index()] -> {ex}");

                return(Redirect("~/Error/Error"));
            }
        }
        public void GetAll_Returns_CorrectType()
        {
            //Arrange
            _pacienteRepositoryMock.Expects.One.Method(x => x.GetAll()).WillReturn(new List <PacienteModel>()
            {
                new PacienteModel()
                {
                    idPaciente = Guid.Empty
                }
            });

            //Act
            var result = _listaPacienteService.GetAll().ToList();

            //Assert
            Assert.AreEqual(result[0].idPaciente, Guid.Empty);
        }