コード例 #1
0
        public void DeleteDiscountTest()
        {
            Discount discount = new Discount();

            discount.Percent  = 20;
            discount.Validity = DateTime.Now;
            discount.ClientId = 1000;
            DiscountDAO discountDAO = new DiscountDAO();

            discountDAO.AddDiscount(discount);

            List <Discount> list = discountDAO.GetDiscount((int)discount.ClientId);

            discount = list[list.Count - 1];
            discountDAO.DeleteDiscount(discount.Id);

            list = discountDAO.GetDiscount((int)discount.ClientId);

            Assert.IsFalse(list.Exists(l => l.Id == discount.Id));
        }