public void hUpdateVolPhone(sp_Phone_DM Phone, string phoneNumber,bool primaryNumber) { sp_VolPhone_BLL VolPhoneBll = new sp_VolPhone_BLL(); Phone.PhoneNbr = phoneNumber; Phone.PrimaryFlg = primaryNumber; VolPhoneBll.UpdatePhoneNbr(Phone); }
public void TestVolPhoneUpdate() { sp_VolPhone_BLL volPhoneBLL = new sp_VolPhone_BLL(); sp_Phone_DM updatePhone = volPhoneBLL.ListPrimaryPhone(primaryTestVolPhone); String newPhoneNbr = "9876543210"; updatePhone.PhoneNbr = newPhoneNbr; volPhoneBLL.UpdatePhoneNbr(updatePhone); sp_Phone_DM selectedPhone = volPhoneBLL.ListPrimaryPhone(updatePhone); primaryTestVolPhone.PhoneNbr = newPhoneNbr; //To get all phones listed, create a new domain model with no phoneID specified. sp_Phone_DM selectAllPhones = new sp_Phone_DM(); selectAllPhones.VolID = updatePhone.VolID; List<sp_Phone_DM> selectedPhoneList = volPhoneBLL.ListPhones(selectAllPhones); Assert.IsTrue(PhoneListContains(selectedPhoneList, updatePhone)); Assert.IsTrue(PhoneListContains(selectedPhoneList, secondaryTestVolPhone)); Assert.IsTrue(PhoneEquals(selectedPhone, updatePhone)); Assert.AreEqual(newPhoneNbr, selectedPhone.PhoneNbr); }