public void Exists_Return_FalseWhenPacientIsNull() { //Arrange _pacienteRepositoryMock.Expects.AtMost(1).Method(x => x.Exists(Guid.Empty)).With(Is.TypeOf(typeof(Guid))).WillReturn(false); //Act var result = _pacienteService.Exists(Guid.Empty); //Assert Assert.AreEqual(result, false); }
// GET: /PrimeraVisita/Create public ActionResult Create(Guid idpaciente) { try { FormPrimeraVisita form = new FormPrimeraVisita(); if (_pacienteService.Exists(idpaciente) == true) { form.IdPaciente = idpaciente; } else { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } return(View()); } catch (Exception ex) { _log.Error($"[Method: Create(Guid idPaciente)] -> {ex}"); return(Redirect("~/Error/Error")); } }