public void TestDeleteVolSkill() { string[] insertNames = { "Volunteer.xlsx", "Group.xlsx", "GroupVol.xlsx", "VolAddress.xlsx", "VolAddr.xlsx", "Skill.xlsx", "VolSkill.xlsx", "VolState.xlsx", "VolEmail.xlsx", "VolPhone.xlsx"}; cExcel.RemoveAllData(); cExcel.InsertData(insertNames); string directory = cExcel.GetHelperFilesDir(); string hdir = cExcel.GetHelperFilesDir(); sp_VolSkill_BLL volskillBLL = new sp_VolSkill_BLL(); string query = "SELECT * FROM [Sheet1$]"; DataTable dtvolskill = cExcel.QueryExcelFile(hdir + "VolSkill.xlsx", query); foreach (DataRow row in dtvolskill.Rows) { //Delete a volskill int before = cExcel.getNumRecordsFromDB("Vol.tblVolSkill"); volskillBLL.DeleteVolSkillALL(new Guid(row["VolID"].ToString())); int after = cExcel.getNumRecordsFromDB("Vol.tblVolSkill"); Assert.AreEqual(before - 1, after); } cExcel.RemoveData(insertNames); }