Ejemplo n.º 1
0
 public void TestContactDelete()
 {
     DataTable dt = cExcel.ReadExcelFile("Sheet1", Path.Combine(cExcel.GetHelperFilesDir(), "Contact.xlsx"));
         foreach (DataRow row in dt.Rows) // Loop over the rows.
         {
             string contactID = row["ContactID"].ToString();
             sp_Contact_DM data = new sp_Contact_DM();
             data.ContactID = new Guid(contactID);
             sp_Contact_BLL contact = new sp_Contact_BLL();
             contact.DeleteContactContext(data.ContactID);
             data = contact.ListContacts(new Guid(contactID));
             Assert.AreEqual(false, data.ActiveFlg, "ActiveFlag not set as expected");
         }
 }
Ejemplo n.º 2
0
 public void TestContactCreate()
 {
     sp_Contact_DM data = new sp_Contact_DM();
     data.ContactID = new Guid();
     string insertFirstName = "A";
     string insertMiddleName = "J";
     string insertLastName = "Riz";
     data.ContactFirstName = insertFirstName;
     data.ContactMiddleName = insertMiddleName;
     data.ContactLastName = insertLastName;
     data.ActiveFlg = true;
     sp_Contact_BLL contact = new sp_Contact_BLL();
     contact.InsertContactContext(ref data);
     Assert.AreEqual(insertFirstName, data.ContactFirstName, "Contact First Name Not Set As Expected");
     Assert.AreEqual(insertMiddleName, data.ContactMiddleName, "Contact Middle Name Not Set As Expected");
     Assert.AreEqual(insertLastName, data.ContactLastName, "Contact Last Name Not Set As Expected");
 }
Ejemplo n.º 3
0
        public void TestContactEmailCreate()
        {
            //Insert a Contact First
            sp_Contact_DM contact_dm = new sp_Contact_DM();
            contact_dm.ContactID = new Guid();
            sp_Contact_BLL contact_bll = new sp_Contact_BLL();
            contact_bll.InsertContactContext(ref contact_dm);

            //Insert an ContactEmail
            sp_ContactEmail_DM data = new sp_ContactEmail_DM();
            data.ContactID = contact_dm.ContactID;
            data.EmailID = 1;
            data.PrimaryEmail = true;
            sp_ContactEmail_BLL vendor = new sp_ContactEmail_BLL();
            vendor.InsertContactEmailContext(data);
            var newdata = vendor.ListContactEmails(data.ContactID, data.EmailID);
            Assert.AreEqual(data.ContactID, newdata.ContactID, "Contact ID Not Set As Expected");
            Assert.AreEqual(data.EmailID, newdata.EmailID, "Email ID Not Set As Expected");
            Assert.AreEqual(data.PrimaryEmail, newdata.PrimaryEmail, "PrimaryEmail Not Set As Expected");
        }
Ejemplo n.º 4
0
        public void TestContactUpdate()
        {
            //Test Our Read
            DataTable dt = cExcel.ReadExcelFile("Sheet1", Path.Combine(cExcel.GetHelperFilesDir(), "Contact.xlsx"));
            foreach (DataRow row in dt.Rows) // Loop over the rows.
            {
                string updateFirstName = "TestFirstName";
                string updateMiddleName = "TestMiddleName";
                string updateLastName = "TestLastName";
                string contactID = row["ContactID"].ToString();
                sp_Contact_DM data = new sp_Contact_DM();
                data.ContactID = new Guid(contactID);
                data.ContactFirstName = updateFirstName;
                data.ContactMiddleName = updateMiddleName;
                data.ContactLastName = updateLastName;
                sp_Contact_BLL contact = new sp_Contact_BLL();
                contact.UpdateContactContext(data);
                data = contact.ListContacts(new Guid(contactID));
                Assert.AreEqual(updateFirstName, data.ContactFirstName, "Contact First Name Not Set As Expected");
                Assert.AreEqual(updateMiddleName, data.ContactMiddleName, "Contact Middle Name Not Set As Expected");
                Assert.AreEqual(updateLastName, data.ContactLastName, "Contact Last Name Not Set As Expected");

            }
        }
Ejemplo n.º 5
0
 public void UpdateContactContext(sp_Contact_DM contact)
 {
     dal.UpdateContactContext(contact);
 }
Ejemplo n.º 6
0
 public void InsertContactContext(ref sp_Contact_DM contact)
 {
     dal.InsertContactContext(ref contact);
 }