public void TestVendorProjContactDelete() { DataTable dt = cExcel.ReadExcelFile("Sheet1", Path.Combine(cExcel.GetHelperFilesDir(), "tblVendorProjContact.xlsx")); foreach (DataRow row in dt.Rows) // Loop over the rows. { Guid VendorID = new Guid(row["VendorID"].ToString()); Guid ProjectID = new Guid(row["ProjectID"].ToString()); Guid ContactID = new Guid(row["ContactID"].ToString()); sp_VendorProjContact_DM data = new sp_VendorProjContact_DM(); sp_VendorProjContact_BLL vend = new sp_VendorProjContact_BLL(); data.VendorID = VendorID; data.ProjectID = ProjectID; data.ContactID = ContactID; vend.DeleteContactContext(data); data = vend.ListContact(VendorID, ProjectID, ContactID); Assert.AreEqual(false, data.PrimaryContact, "PrimaryContact not set as expected"); } }
public void TestVendorProjContactRead() { //Test Our Read DataTable dt = cExcel.ReadExcelFile("Sheet1", Path.Combine(cExcel.GetHelperFilesDir(), "tblVendorProjContact.xlsx")); foreach (DataRow row in dt.Rows) // Loop over the rows. { string vendorID = row["VendorID"].ToString(); string projectID = row["ProjectID"].ToString(); string contactID = row["ContactID"].ToString(); sp_VendorProjContact_BLL contact = new sp_VendorProjContact_BLL(); sp_VendorProjContact_DM data = contact.ListContact(new Guid(vendorID), new Guid(projectID), new Guid(contactID)); Assert.AreEqual(Convert.ToBoolean(row["PrimaryContact"]), data.PrimaryContact, "Primary Contact Not Set As Expected"); } }