public async Task TestInsertProductNullName() { var newProd = new ChemiChemicals.Repository.Entities.Product { SupplierName = "test", BinaryContent = "testing binary content", Url = "http://test.com" }; var ex = await Assert.ThrowsAsync <SqlException>(async() => await new Product().InsertProduct(newProd)); }
public async Task TestInsertProduct() { var newProd = new ChemiChemicals.Repository.Entities.Product { ProductName = "test", SupplierName = "test", BinaryContent = "testing binary content", Url = "http://test.com" }; var product = await new Product().InsertProduct(newProd); Assert.NotNull(product); }
public static ChemiChemicals.EndPoint.Models.Product ModelMapping(ChemiChemicals.Repository.Entities.Product product) { return(new ChemiChemicals.EndPoint.Models.Product { ID = product.ID, ProductName = product.ProductName, SupplierName = product.SupplierName, BinaryContent = product.BinaryContent, Url = product.Url, InsertionDate = product.InsertionDate, IsChanged = product.IsChanged }); }
public async Task TestUpdateProduct() { var updatingProduct = new ChemiChemicals.Repository.Entities.Product { ProductName = "test update", SupplierName = "test update", BinaryContent = "testing update binary content", Url = "http://testupdate.com", ID = Guid.Parse("FAB67A68-0F2D-485E-8197-03E13A1A244B") }; var product = await new Product().UpdateProduct(updatingProduct); Assert.NotNull(product); }