public void TestEdit()
        {
            DataTable tb      = sp.GetTableProduct();
            SanPham   sanPham = new SanPham(1, "Gà luộc", "Con", 150000);
            int       index   = 0;

            sp.Edit(sanPham, tb, index);

            int    maSP, giaBan;
            string ten, donVi;

            maSP   = int.Parse(tb.Rows[index]["MaSP"].ToString());
            giaBan = int.Parse(tb.Rows[index]["GiaBan"].ToString());
            ten    = tb.Rows[index]["Ten"].ToString();
            donVi  = tb.Rows[index]["DonVi"].ToString();

            Assert.AreEqual(1, maSP);
            Assert.AreEqual("Gà luộc", ten);
            Assert.AreEqual("Con", donVi);
            Assert.AreEqual(150000, giaBan);
        }
Пример #2
0
 public void Edit_Bus(SanPham sp, DataTable dt, int index)
 {
     product.Edit(sp, dt, index);
 }