示例#1
0
        // GET: /DiagnosticoTratamiento/Edit
        public ActionResult Edit(Guid?idDiagnostico)
        {
            try
            {
                if (idDiagnostico == null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }

                List <object> objects = _diagnosticoTratamientoService.Get((Guid)idDiagnostico);

                if (!objects.Any())
                {
                    return(HttpNotFound());
                }

                FormDiagnosticoTratamiento form = new FormDiagnosticoTratamiento((DiagnosticoDto)objects[0], (MaterialSoportePlantarDto)objects[1]);

                return(View(form));
            }
            catch (Exception ex)
            {
                _log.Error($"[Method: Edit(Guid? idDiagnostico)] -> {ex}");

                return(Redirect("~/Error/Error"));
            }
        }
示例#2
0
        public void Get_Return_ObjectList()
        {
            //Arrange
            _diagnosticoRepositoryMock.Expects.One.Method(x => x.GetByid(Guid.Empty))
            .With(Is.TypeOf(typeof(Guid))).WillReturn(new DiagnosticoModel()
            {
                idDiagnostico = Guid.Empty, id_tratamiento = Guid.Empty
            });
            _materialSoportePlantarRepositoryMock.Expects.One.Method(x => x.GetByIdTratamiento(Guid.Empty)).With(Is.TypeOf(typeof(Guid)))
            .WillReturn(new MaterialSoportePlantarModel()
            {
                idMaterialSoportePlantar = Guid.Empty, id_tratamiento = Guid.Empty
            });

            //Act
            var result      = _diagnosticoTratamientoService.Get(Guid.Empty);
            var consultaDto = (DiagnosticoDto)result[0];
            var materialSoportePlantarDto = (MaterialSoportePlantarDto)result[1];

            //Assert
            Assert.AreEqual(typeof(DiagnosticoDto), consultaDto.GetType());
            Assert.AreEqual(typeof(MaterialSoportePlantarDto), materialSoportePlantarDto.GetType());
        }