public void DeleteTest() { SupplierDAL dal = new SupplierDAL(); Supplier s = new Supplier(); s.SupplierID = "2"; Assert.IsTrue(dal.Delete(s)); Assert.IsNull(dal.FindByID("2")); s.SupplierID = "6"; Assert.IsFalse(dal.Delete(s)); }
//deleta os dados de um dado fornecedor na tabela public Response Delete(Supplier supplier) { Response resultDelete = _supplierDAL.Delete(supplier); if (!resultDelete.Success) { return(resultDelete); } return(Response.CreateSuccess("Fornecedor removido com sucesso!")); }
public void DeleteTest() { Supplier s = new Supplier(); s.SupplierID = "123"; SupplierDAL target = new SupplierDAL(); bool atual = target.Delete(s); //实际的结果 bool expected = true; //预期的结果 Assert.AreEqual(expected, atual); //断言判等 //测试无效的 s.SupplierID = "123"; atual = target.Delete(s); //实际的结果 expected = false; //预期的结果 Assert.AreEqual(expected, atual); //断言判等 }
static public bool Destory(List <int> list, out string msg) { if (list == null || list.Count == 0) { msg = "没有记录需要销毁"; return(false); } for (int i = 0; i < list.Count; i++) { if (!SupplierDAL.Delete(list[i], out msg)) { return(false); } } msg = ""; return(true); }
public Supplier Delete(long id) { return(supplierDAL.Delete(id)); }
public Supplier Delete(long id) { return(dal.Delete(id)); }
public bool Delete(Supplier o) { return(sDAL.Delete(o)); }
public int Delete(Supplier supplier) { return(supplierDAL.Delete(supplier.ID)); }