示例#1
0
 public void CalculateTotalTest3()
 {
     Terminal t = new Terminal(products);
     t.SetPrices();
     t.Scan("A");
     t.Scan("B");
     t.Scan("C");
     t.Scan("D");
     Assert.AreEqual(t.CalculateTotal(), 15.40);
 }
示例#2
0
 public void CalculateTotalTest2()
 {
     Terminal t = new Terminal(products);
     t.SetPrices();
     t.Scan("C");
     t.Scan("C");
     t.Scan("C");
     t.Scan("C");
     t.Scan("C");
     t.Scan("C");
     t.Scan("C");
     Assert.AreEqual(t.CalculateTotal(), 7.25);
 }
示例#3
0
 public void GetItemCatalogTest()
 {
     Terminal t = new Terminal(products);
     t.SetPrices();
     var catalog = t.GetItemCatalog();
     Assert.AreEqual(catalog.GetType(), typeof(ItemCatalog));
     Assert.AreEqual(catalog.GetCount(), 4);
 }
示例#4
0
 public void GetDataTest()
 {
     Terminal t = new Terminal(products);
     Assert.AreEqual(t.GetData(), products);
 }
示例#5
0
 public void ScanTest2()
 {
     Terminal t = new Terminal(products);
     t.SetPrices();
     t.Scan("A");
     t.Scan("C");
     var cart = t.GetCart();
     Assert.AreEqual(cart.GetContents().Count, 2);
     Assert.AreEqual(cart.GetItem("A").quantity, 1);
     Assert.AreEqual(cart.GetItem("A").GetName(), "A");
     Assert.AreEqual(cart.GetItem("A").GetProduct().GetName(), "A");
     Assert.AreEqual(cart.GetItem("A").GetProduct().GetPrice(), 2.00);
     Assert.AreEqual(cart.GetItem("C").quantity, 1);
     Assert.AreEqual(cart.GetItem("C").GetName(), "C");
     Assert.AreEqual(cart.GetItem("C").GetProduct().GetName(), "C");
     Assert.AreEqual(cart.GetItem("C").GetProduct().GetPrice(), 1.25);
 }