Пример #1
0
        public void UpdateDiscountTest()
        {
            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];
            discount.Percent = 5;
            discountDAO.UpdateDiscount(discount);

            list = discountDAO.GetDiscount((int)discount.ClientId);
            string expected = ToStringWithoutId(discount);
            string actual   = ToStringWithoutId(list[list.Count - 1]);

            Assert.AreEqual(expected, actual);
        }