public void InsertTest() { //有效的 PurchaseBill p = new PurchaseBill(); p.PurchaseID = "20160130001"; p.SupplierID = "0"; p.PurchaseDate = Convert.ToDateTime("2015-05-06"); p.StockDate = new DateTime(); p.Clerk = "1"; p.Examiner = "2"; p.Custodian = "3"; p.OnProcess = 0; p.Memo = "哈哈哈"; List <PurchaseDetail> pdd = new List <PurchaseDetail>(); PurchaseDetail pd = new PurchaseDetail(); pd.PurchaseID = "20160130001"; pd.PurchaseDetailID = 1; pd.ProductID = "0002"; pd.PurchasePrice = 2; pd.Quantity = 100; pdd.Add(pd); p.DetailList = pdd; PurchaseBillDAL target = new PurchaseBillDAL(); bool atual = target.Insert(p); //实际的结果 bool expected = true; //预期的结果 Assert.AreEqual(expected, atual); //断言判等 }
public bool Insert(PurchaseBill o) { return(pDAL.Insert(o)); }
public bool Insert(PurchaseBill o) //新增订单 { return(pd.Insert(o)); }