public void GetNRecentlyReviewedProductsTest() { List <Product> products = LINQ_tools.GetNRecentlyReviewedProducts(2); Assert.AreEqual(products.Count(), 2); Assert.AreEqual(products[0].ProductNumber, "PD-M562"); }
public void GetNProductsFromCategoryTest() { List <Product> products = LINQ_tools.GetNProductsFromCategory("Bikes", 4); Assert.AreEqual(products.Count(), 4); Assert.AreEqual(products[0].ProductNumber, "BK-M82S-38"); }
public void GetProductsByVendorNameTest() { List <Product> products = LINQ_tools.GetProductsByVendorName("Australia Bike Retailer"); Assert.AreEqual(products.Count(), 16); Assert.AreEqual(products[0].ProductNumber, "LJ-1213"); }
public void GetProductsWithNRecentReviewsTest() { List <Product> products = LINQ_tools.GetProductsWithNRecentReviews(1); Assert.AreEqual(products.Count(), 2); Assert.AreEqual(products[0].ProductNumber, "SO-B909-M"); }
public void GetProductNamesByVendorNameTest() { List <string> products = LINQ_tools.GetProductNamesByVendorName("Australia Bike Retailer"); Assert.AreEqual(products.Count(), 16); Assert.AreEqual(products[0], "Thin-Jam Lock Nut 9"); }
public void GetProductsByNameTest() { List <Product> products = LINQ_tools.GetProductsByName("Down Tube"); Assert.AreEqual(products.Count(), 1); Assert.AreEqual(products[0].ProductNumber, "DT-2377"); }
public void GetTotalStandardCostByCategoryTest() { ProductCategory category = new ProductCategory(); category.Name = "Bikes"; int sum = LINQ_tools.GetTotalStandardCostByCategory(category); Assert.AreEqual(sum, 92092); }
public IEnumerable <MyProduct> GetAllProducts() { List <MyProduct> myProducts = new List <MyProduct>(); foreach (Product p in LINQ_tools.GetAllProducts()) { myProducts.Add(new MyProduct(p)); } return(myProducts); //return (IEnumerable<MyProduct>)LINQ_tools.GetAllProducts(); }
public void Update(MyProduct product) { Product p = new Product(); p.ProductID = product.ProductID; p.ProductNumber = product.ProductNumber; p.Name = product.Name; p.ModifiedDate = product.ModifiedDate; p.SellStartDate = product.SellStartDate; p.SellEndDate = product.SellEndDate; p.SafetyStockLevel = product.SafetyStockLevel; p.ReorderPoint = product.ReorderPoint; p.Color = product.Color; p.rowguid = product.rowguid; LINQ_tools.UpdateProduct(p); product.ProductID = p.ProductID; }
public void GetProductVendorByProductNameTest() { string vendors = LINQ_tools.GetProductVendorByProductName("Decal 2"); Assert.AreEqual(vendors, "SUPERSALES INC."); }
public void Delete(int id) { LINQ_tools.DeleteProductId(id); }
public MyProduct Read(int id) { Product p = LINQ_tools.GetProductById(id); return(new MyProduct(p)); }