public void ProductTest() { l.Product product = new l.Product { ProductId = 1, ProductName = "NS", UnitPrice = (decimal)299.99 }; Assert.Equal(1, product.ProductId); Assert.Equal("NS", product.ProductName); Assert.Equal((decimal)299.99, product.UnitPrice); }
/// <summary> /// while placing an order, search database to retrieve current product and price /// </summary> /// <param name="productId"></param> /// <returns></returns> public l.Product SearchProduct(int productId) { d.Product product = dbcontext.Product.Find(productId); if (product == null) { return(null); } else { l.Product storeFind = Mapper.MapProduct(product); return(storeFind); } }
public l.Product SearchProduct(int productId) { d.Product productDB = dbcontext.Product.Find(productId); l.Product productL = Mapper.MapProduct(productDB); return(productL); }