Example #1
0
 public void GetTest()
 {
     ItemCatalog catalog = new ItemCatalog(products);
     var a = catalog.Get("A");
     Assert.AreEqual(a.GetName(), "A");
     Assert.AreEqual(a.GetPrice(), 2.00);
     Assert.AreEqual(a.GetDiscounts(), packA);
     var b = catalog.Get("B");
     Assert.AreEqual(b.GetName(), "B");
     Assert.AreEqual(b.GetPrice(), 12.00);
     Assert.AreEqual(b.GetDiscounts(), new Discount[] { });
     var c = catalog.Get("C");
     Assert.AreEqual(c.GetName(), "C");
     Assert.AreEqual(c.GetPrice(), 1.25);
     Assert.AreEqual(c.GetDiscounts(), packC);
     var d = catalog.Get("D");
     Assert.AreEqual(d.GetName(), "D");
     Assert.AreEqual(d.GetPrice(), 0.15);
     Assert.AreEqual(d.GetDiscounts(), new Discount[] { });
 }
Example #2
0
 /*
  * Turn product data into an ItemCatalog
  */
 public void SetPrices()
 {
     _catalog = new ItemCatalog(_dt);
 }
Example #3
0
 public void GetCountTest()
 {
     var catalog = new ItemCatalog(products);
     Assert.AreEqual(catalog.GetCount(), 4);
 }
Example #4
0
 public void InvalidProductTest()
 {
     var catalog = new ItemCatalog(products);
     Product a = catalog.Get("E");
 }