コード例 #1
0
        // GET: /PrimeraVisita/Edit
        public ActionResult Edit(Guid?idvisita)
        {
            try
            {
                if (idvisita == null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }

                PrimeraVisitaDto visita = _primeraVisitaService.Get((Guid)idvisita);

                if (visita == null)
                {
                    return(HttpNotFound());
                }

                FormPrimeraVisita form = visita.PrimeraVisitaDtoToFormPrimeraVisita();

                ViewBag.Podologos = new SelectList(_primeraVisitaService.GetPodologos(), "Nombre", "IdPodologo", form.IdPodologo);

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

                return(Redirect("~/Error/Error"));
            }
        }
コード例 #2
0
        public void Get_Return_Ok()
        {
            //Arrange
            _primeraVisitaRepositoryMock.Expects.AtLeast(1).Method(x => x.Get(Guid.Empty)).WithAnyArguments().WillReturn(new PrimeraVisitaModel()
            {
                idPrimeraVisita = Guid.Empty
            });

            //Act
            var result = _primeraVisitaService.Get(Guid.Empty);

            //Assert
            Assert.AreEqual(typeof(PrimeraVisitaDto), result.GetType());
            Assert.AreEqual(result.idPrimeraVisita, Guid.Empty);
        }