public void AddProduct1() { int expected1 = product.GetListProducts().Rows.Count + 1; int actual1 = 0; DTO.Warehouse.DtoProduct dto = new DTO.Warehouse.DtoProduct("SP127", "USB Tosiba", "Phụ kiện", 60, 100000.0000, 150000.0000, 20, "cái", "Hàng Trung Qu?c"); int expected = 1; int actual = product.AddProduct(dto); Assert.AreEqual(expected, actual); actual1 = product.GetListProducts().Rows.Count; Assert.AreEqual(actual, expected); Assert.AreEqual(actual1, expected1); product.DeleteProduct(dto.MaSanPham); }
public DataTable GetListProducts() { return(_dalProduct.GetListProducts()); //DataTable dt = _dalProduct.GetListProducts(); //List<DtoProduct> products = new List<DtoProduct>(); //foreach (DataRow row in dt.Rows) //{ // DtoProduct pro = new DtoProduct( // row[0].ToString(), // row[1].ToString(), // row[2].ToString(), // row[3].ToString(), // int.Parse(row[4].ToString()), // double.Parse(row[5].ToString()), // double.Parse(row[6].ToString()), // int.Parse(row[7].ToString()), // row[8].ToString(), // row[9].ToString(), // row[10].ToString()); // products.Add(pro); //} //return products; }
public void GetListProductsTest1() { Assert.IsNotNull(product.GetListProducts()); }