public void FindByIDTest() { PurchaseBillDAL pdal = new PurchaseBillDAL(); PurchaseBill list = pdal.FindByID("201706010001"); Assert.IsNotNull(list); Assert.IsNull(pdal.FindByID("2165321010")); Assert.AreEqual("201706010001", list.PurchaseID); Assert.AreEqual(Convert.ToDateTime("2018.10.1"), list.PurchaseDate); Assert.AreEqual("1", list.Clerk); Assert.AreEqual(3, list.DetailList.Count); //从明细列表中取出一行明细进行测试 PurchaseDetail pDetail = list.DetailList[0]; Assert.AreEqual("1", pDetail.PurchaseDetailID); Assert.AreEqual(Convert.ToDecimal(3), pDetail.PurchasePrice); Assert.AreEqual("10", pDetail.Quantity); }
public PurchaseBill FindByID(string id) { return(pDAL.FindByID(id)); }
public PurchaseBill FindByID(string id) //根据ID查询订单基本信息和订单明细 { return(pd.FindByID(id)); }