public async Task Del() { deliveryContext pedidospollomonContext = new deliveryContext(); FotosController fotosController = new FotosController(pedidospollomonContext); var result = await fotosController.DeleteFoto(idFoto); Assert.IsNotNull(result); }
public async Task Get() { deliveryContext pedidosContext = new deliveryContext(); FotosController fotosController = new FotosController(pedidosContext); var result = await fotosController.GetFoto(new PageAndSortRequest() { Pagina = 1, TamPagina = 10, Columna = "Id", Direccion = "asc", Filtro = "" }); Assert.IsNotNull(result); Assert.IsTrue(result.Value.Datos.Count() > 0); }
public async Task Add() { deliveryContext pedidospollomonContext = new deliveryContext(); FotosController fotosController = new FotosController(pedidospollomonContext); var result = await fotosController.PostFoto(new Foto() { Descripcion = "testFa", PathImg = "testFa", IdProductoNavigation = new Producto { Nombre = "Coca cola 2lts.", PrecioUnitario = 15, Cantidad = 2, PrecioMayor = 10, Marca = "Embol S.A", Modelo = "Coca-Cola", Especificaciones = "Gaseosa negra de 2 lts", IdCategoriaNavigation = new CategoriaProducto { Nombre = "Gaeosas", Descripcion = "liquidos en base a componentes gaseoss", Lugar = "Sección refrigerantes" }, IdVendedorNavigation = new Vendedor { PersonaContacto = "Pedro Fuentes Lazarraga", Celular = "72967356", Telefono = "466-23058", Correo = "*****@*****.**", NombreEmpresa = "Arcor", Direccion = "Zona mercader Av. Ballivian", PathLogo = "", IdRubroNavigation = new Rubro { Nombre = "Comida Rápida", Descripcion = "encargados del área de comida rapida y derivados" } } } }); Assert.IsNotNull(result.Result); Foto foto = (Foto)(result.Result as CreatedAtActionResult).Value; Assert.IsNotNull(foto); Assert.IsTrue(foto.Id > 0); idFoto = foto.Id; }