public ActionResult Detalles() { int id; int.TryParse(Request.QueryString["idPaquete"], out id); return(View(PaqueteService.GetPaquete(id))); }
public ActionResult Editar(long id) { if (AutorizarAdmin()) { ViewBag.Accion = "Editar"; return(View(PaqueteService.GetPaquete(id))); } else { return(Redirect(UrlLogin)); } }
public void GetByIdInvalido() { //Arrange int id = new Random().Next(6, 100); PaqueteService service = new PaqueteService(_repository.Object, _query.Object); //Act var result = service.GetPaquete(id); //Assert Assert.IsNull(result); }
public void GetByIdValido() { //Arrange int id = new Random().Next(1, 5); _query.Setup(_ => _.GetPaquete(id)).Returns(new ResponsePaqueteDto() { TipoPaquete = 3.ToString(), Peso = 0, Largo = 0, Ancho = 0, Alto = 0 }); PaqueteService service = new PaqueteService(_repository.Object, _query.Object); //Act var result = service.GetPaquete(id); //Assert Assert.IsNotNull(result); }