コード例 #1
0
        public void EditStockInDatabase()
        {
            Discount      discount = new Discount("D107", DiscountTypeEnum.Hidden, DateTime.Parse("01/01/2018"), DateTime.Parse("31/12/2018"), 50, true);
            Product       product  = new Product("P111", "BOX", 100, "this is a plastic box");
            StockListItem expected = new StockListItem(10, product, discount, PurchaseEnum.Immediate, "S1");

            handler.AddStockListItemToDataBase(expected);
            StockListItem find = handler.GetStockListItembyProductID("P111");

            Assert.AreEqual(expected, find);
            expected.Quantity = 3;
            Assert.AreNotEqual(expected, find);
            handler.EditStockInDatabase(expected);
            find = handler.GetStockListItembyProductID("P111");
            Assert.AreEqual(expected, find);
        }