public void GetProductVendorByProductName_ShouldReturnProperValues() { var productName = "Reflector"; var vendor = DM.GetProductVendorByProductName(productName); Assert.AreEqual(vendor, "Chicago Rent-All"); }
public void GetProductsWithNRecentReviews_ShouldReturnProperValues() { var products = DM.GetProductsWithNRecentReviews(2); Assert.AreEqual(products.Count, 1); Assert.IsNotNull(products.Find(p => p.ProductID == 937)); }
public void GetNProductsFromCategory_ShouldReturnProperValues() { var categoryName = "Accessories"; var productAmounts = 5; var products = DM.GetNProductsFromCategory(categoryName, productAmounts); Assert.AreEqual(products.Count, productAmounts); }
public void GetNRecentlyReviewedProductsImperative_ShouldReturnProperValues() { var products = DM.GetNRecentlyReviewedProductsImperative(2); Assert.AreEqual(products.Count, 2); Assert.IsNotNull(products.Find(p => p.ProductID == 798)); Assert.IsNotNull(products.Find(p => p.ProductID == 937)); }
public void GetPagedExtensionMethod() { var categoryName = "Accessories"; var productAmounts = 10; var products = DM.GetNProductsFromCategory(categoryName, productAmounts); var page = products.GetPaged(3, 2); Assert.AreEqual(page.Count, 3); }
public void GetProductsNamesByVendorName_ShouldReturnProperValues() { var vendorName = "Capital Road Cycles"; var productAmounts = 2; var products = DM.GetProductsNamesByVendorName(vendorName); Assert.AreEqual(products.Count, productAmounts); Assert.IsNotNull(products.Find(p => p == "LL Spindle/Axle")); Assert.IsNotNull(products.Find(p => p == "HL Spindle/Axle")); }
public void GetProductsByName_ShouldReturnProperValues() { var name = "Fork"; var products = DM.GetProductsByName(name); foreach (var p in products) { Assert.IsTrue(p.Name.Contains(name)); } }
public void GetProductsAndTheirVendors() { var categoryName = "Accessories"; var productAmounts = 2; var products = DM.GetNProductsFromCategory(categoryName, productAmounts); // helper var report = products.GetProductsAndTheirVendors(); foreach (var p in products) { Assert.IsTrue(report.Contains(p.Name)); } }
public void GetTotalStandardCostByCategory_NonExistingCategory() { var categoryId = 5; var properTotalCost = 0; var returnedCost = DM.GetTotalStandardCostByCategory( new ProductCategory { ProductCategoryID = categoryId }); Assert.AreEqual(returnedCost, properTotalCost); }
public void GetTotalStandardCostByCategory_ShouldReturnProperValues() { var categoryId = 4; var properTotalCost = 384; var returnedCost = DM.GetTotalStandardCostByCategory( new ProductCategory { ProductCategoryID = categoryId }); Assert.AreEqual(returnedCost, properTotalCost); }