Ejemplo n.º 1
0
        public void SubTotalCalcTest0qty()
        {
            Product        item        = new Product(Category.Test, "test.Test", "Test category item", .99m);
            Product        genericItem = new Product(Category.Generic, "gernericItem.Generic", "Generic category", 1.00m);
            List <Product> test3       = new List <Product>();

            test3.Add(item);
            test3.Add(genericItem);
            Assert.Equal(0, TerminalFlow.CalculateSubTotal(test3));
        }
Ejemplo n.º 2
0
        public void AddItemTest_FirstItem()
        {
            Product item = new Product(Category.Test, "MenuTest3.Test", "item", .99m);

            List <Product> testorder = new List <Product>();
            List <Product> expected  = new List <Product>();

            expected.Add(item);

            Assert.Equal(expected, TerminalFlow.AddItem(item, 1, testorder));
        }
Ejemplo n.º 3
0
        public void AddItem_QtyItem()
        {
            Product item = new Product(Category.Test, "MenuTest3.Test", "item", .99m);

            List <Product> testorder = new List <Product>();
            List <Product> expected  = new List <Product>();

            expected.Add(item);
            expected[0].Quantity = 2;

            Assert.Equal(expected, TerminalFlow.AddItem(item, 2, testorder));
        }
Ejemplo n.º 4
0
        public void SubTotalCalcTest1qty()
        {
            Product        item  = new Product(Category.Test, "test", "test", .99m);
            Product        gitem = new Product(Category.Generic, "test", "test", 1.00m);
            List <Product> test2 = new List <Product>();

            test2.Add(item);
            test2.Add(gitem);
            test2[0].Quantity = 1;
            test2[1].Quantity = 1;
            decimal total = test2[0].Price + test2[1].Price;

            Assert.Equal(total, TerminalFlow.CalculateSubTotal(test2));
        }