public ListEmails ( |
||
cVolEmail | ||
Результат | List |
public List<sp_Email_DM> hSelectVolEmail(sp_Email_DM givenEmail) { List<sp_Email_DM> EmailList = null; sp_VolEmail_BLL VolEmailBll = new sp_VolEmail_BLL(); EmailList = VolEmailBll.ListEmails(givenEmail); return EmailList; }
public void TestVolEmailCreate() { sp_Volunteer_BLL vol_bll = new sp_Volunteer_BLL(); sp_Volunteer_DM vol_dm = new sp_Volunteer_DM(); vol_dm.VolFirstName = "createFirst"; vol_dm.VolMiddleName = "createMiddle"; vol_dm.VolLastName = "createLast"; vol_dm.ActiveFlg = true; System.Guid volID = vol_bll.InsertVolunteerContext(ref vol_dm).VolID; vol_dm.VolID = volID; string volEmailAddr = "*****@*****.**"; bool PrimaryFlg = true; bool ActiveFlg = true; sp_VolEmail_BLL volEmail_bll = new sp_VolEmail_BLL(); sp_Email_DM volEmail_dm = new sp_Email_DM(); volEmail_dm.EmailAddr = volEmailAddr; volEmail_dm.VolID = volID; volEmail_dm.ActiveFlg = ActiveFlg; volEmail_dm.PrimaryFlg = PrimaryFlg; volEmail_bll.InsertEmailContext(ref volEmail_dm); int volEmailID = volEmail_dm.EmailID; List<sp_Email_DM> volEmailDMs_selected = volEmail_bll.ListEmails(volEmail_dm); Assert.IsTrue(EmailListContains(volEmailDMs_selected,volEmail_dm)); }
public void TestVolEmailRead() { string helperDir = cExcel.GetHelperFilesDir(); DataTable dt = cExcel.ReadExcelFile("Sheet1", Path.Combine(helperDir, "VolEmail.xlsx")); List<sp_Email_DM> excelDMs = getVolEmailDMs(dt); sp_VolEmail_BLL volEmail_bll = new sp_VolEmail_BLL(); foreach (sp_Email_DM testVolEmail in excelDMs) { List<sp_Email_DM> selectedVolEmails = volEmail_bll.ListEmails(testVolEmail); Assert.IsTrue(EmailListContains(selectedVolEmails,testVolEmail)); } }
public void TestVolEmailUpdate() { sp_VolEmail_BLL volEmailBLL = new sp_VolEmail_BLL(); volEmailBLL.InsertEmailContext(ref primaryTestVolEmail); sp_Email_DM updateEmail = volEmailBLL.ListPrimaryEmail(primaryTestVolEmail); String newEmailAddr = "*****@*****.**"; updateEmail.EmailAddr = newEmailAddr; volEmailBLL.UpdateEmailAddr(updateEmail); sp_Email_DM selectedEmail = volEmailBLL.ListPrimaryEmail(updateEmail); //To get all emails listed, create a new domain model with no emailID specified. sp_Email_DM selectAllEmails = new sp_Email_DM(); selectAllEmails.VolID = updateEmail.VolID; List<sp_Email_DM> selectedEmailList = volEmailBLL.ListEmails(selectAllEmails); Assert.IsTrue(EmailListContains(selectedEmailList, updateEmail)); Assert.IsTrue(EmailListContains(selectedEmailList, selectedEmail)); Assert.IsTrue(EmailEquals(selectedEmail,updateEmail)); Assert.AreEqual(newEmailAddr, selectedEmail.EmailAddr); }
public void TestVolEmailDelete() { sp_VolEmail_BLL volEmail_bll = new sp_VolEmail_BLL(); //Can't delete primary emails //volEmail_bll.DeleteEmailsContext(primaryTestVolEmail); //sp_Email_DM selectedVolEmail = volEmail_bll.ListPrimaryEmail(primaryTestVolEmail); volEmail_bll.DeleteEmailsContext(secondaryTestVolEmail); sp_Email_DM selectedVolEmail = volEmail_bll.ListEmails(secondaryTestVolEmail).First(); Assert.IsNotNull(selectedVolEmail.ActiveFlg); Assert.IsFalse(selectedVolEmail.ActiveFlg == true); Assert.IsTrue(selectedVolEmail.ActiveFlg == false); }