public void GetPhones_NoExistingPhones_ReturnEmpty() { mockUnitOfWork.Setup(u => u.Phones.GetAll()) .Returns(new List <Phone>()); var result = manager.GetPhones(); Assert.That(result.Count(), Is.EqualTo(0)); }
public void Verify_The_Number_Of_Records_In_Account_Phones(int numberOfRecords) { _phones = PhoneManager.GetPhones(_testScope.accountId); _testScope.softAssert.Add(() => { Assert.AreEqual(_phones.Count, numberOfRecords); }); }
public void Changing_All_Phones_To_Status(string phoneStatus) { var newStatus = _accountTest.GetPhoneStatusMapping(phoneStatus); var phones = PhoneManager.GetPhones(_testScope.accountId); foreach (var phone in phones) { var newPhone = _accountTest.DuplicateThisPhone(phone); newPhone.PhoneStatusId = newStatus; _accountTest.UpdatePhone(newPhone, phone); } }
public void Changing_Phone_Service(string phoneNumber, Phone.PhoneServiceTypes service) { var phones = PhoneManager.GetPhones(_testScope.accountId); var oldPhone = phones.SingleOrDefault(p => p.PhoneNumber == phoneNumber); if (oldPhone == null) { return; } var newPhone = _accountTest.DuplicateThisPhone(oldPhone); newPhone.ServiceType = service; _accountTest.UpdatePhone(newPhone, oldPhone); }
public void Changing_Phone_Status(string phoneNumber, string phoneStatus) { var phones = PhoneManager.GetPhones(_testScope.accountId); var oldPhone = phones.SingleOrDefault(p => p.PhoneNumber == phoneNumber); if (oldPhone == null) { return; } var newPhone = _accountTest.DuplicateThisPhone(oldPhone); var newStatus = _accountTest.GetPhoneStatusMapping(phoneStatus); newPhone.PhoneStatusId = newStatus; _accountTest.UpdatePhone(newPhone, oldPhone); }
public void VerifyPhoneIsNotAddedToTheAccount(string phoneNumber) { _phones = PhoneManager.GetPhones(_testScope.accountId); var phone = _phones.FirstOrDefault(x => x.PhoneNumber == phoneNumber); if (phone == null) { return; } else { _testScope.softAssert.Add(() => { Assert.Fail("The phone is added, test fail"); }); } }
public void User_Adds_A_New_Phone_Number( string phoneNumber, string phoneStatus, Phone.PhoneLocationTypes location, Phone.PhoneServiceTypes service) { var accountPhones = PhoneManager.GetPhones(_testScope.accountId); if (accountPhones.FirstOrDefault(x => x.PhoneNumber == phoneNumber) != null) { throw new Exception("This number " + phoneNumber + " already existed on the account"); } var status = _accountTest.GetPhoneStatusMapping(phoneStatus); var phoneSlot = accountPhones.GetNextAvailableSlot(); _accountTest.AddPhoneNumber(_testScope.accountId, phoneNumber, service, location, phoneSlot, status); }
public void VerifyThePhoneStatus(int slot, string phoneStatus) { if (slot == 0) { Assert.Fail("Slot = 0, please check the step"); } _phones = PhoneManager.GetPhones(_testScope.accountId); var phone = _phones.FirstOrDefault(x => x.PhoneSlot == slot); if (phone == null) { _testScope.softAssert.Add(() => { Assert.Fail("Account has no phone to test"); }); } else { _testScope.softAssert.Add(() => { Assert.AreEqual(phoneStatus, phone.PhoneStatus.Description); }); } }
public void VerifyThePhoneConsentOnDialer(int slot, Phone.ConsentMode consentMode) { if (slot == 0) { Assert.Fail("Slot = 0, please check the step"); } _phones = PhoneManager.GetPhones(_testScope.accountId); var phone = _phones.FirstOrDefault(x => x.PhoneSlot == slot); if (phone == null) { _testScope.softAssert.Add(() => { Assert.Fail("Account has no phone to test"); }); } else { _testScope.softAssert.Add(() => { Assert.AreEqual(consentMode, phone.ConsentForAutomatedDialing); }); } }
public void VerifyThePhoneServiceType(int slot, Phone.PhoneServiceTypes serviceType) { if (slot == 0) { Assert.Fail("Slot = 0, please check the step"); } _phones = PhoneManager.GetPhones(_testScope.accountId); var phone = _phones.FirstOrDefault(x => x.PhoneSlot == slot); if (phone == null) { _testScope.softAssert.Add(() => { Assert.Fail("Account has no phone to test"); }); } else { _testScope.softAssert.Add(() => { Assert.AreEqual(serviceType, phone.ServiceType); }); } }