public void AvailableLocalPhoneNumbersByAreaCodeShouldReturnAvailablePhoneNumbersList() { var account = new TwilioAccountMock(); var phoneAutomation = new PhoneAutomation(account); var availablePhoneNumbers = phoneAutomation.AvailableLocalPhoneNumbers(1); Assert.IsNotNull(availablePhoneNumbers); }
public void AvailableTollFreePhoneNumbersShouldReturnAvailablePhoneNumbersList() { var account = new TwilioAccountMock(); var phoneAutomation = new PhoneAutomation(account); var availablePhoneNumbers = phoneAutomation.AvailableTollFreePhoneNumbers(); Assert.IsNotNull(availablePhoneNumbers); }
public void CreateSubAccountReturnsNewAccountResource() { var account = new TwilioAccountMock(); var phoneAutomation = new PhoneAutomation(account); var twilioAccount = phoneAutomation.CreateSubAccount("My new account test"); Assert.IsNotNull(twilioAccount); }
public void GetSubAccountsReturnsAccountListResource() { var account = new TwilioAccountMock(); var phoneAutomation = new PhoneAutomation(account); var accounts = phoneAutomation.GetSubAccounts(); Assert.IsNotNull(accounts); }
public void ProvisionNumberShouldReturnNewNumberResource() { var account = new TwilioAccountMock(); var phoneAutomation = new PhoneAutomation(account); var number = phoneAutomation.ProvisionPhoneNumber("555-555-5555"); Assert.IsNotNull(number); }
public void SMSListShouldReturnListOfSMSResources() { var account = new TwilioAccountMock(); var phoneAutomation = new PhoneAutomation(account); var smsList = phoneAutomation.SMSMessageList(); Assert.IsNotNull(smsList); Assert.IsNotNull(smsList.sms_messages); }
public void FetchingSMSResourceByIdShouldReturnSMSResource() { var account = new TwilioAccountMock(); var phoneAutomation = new PhoneAutomation(account); var sms = phoneAutomation.GetSMSMessage("fake_guid"); //some random guid Assert.IsNotNull(sms); }
public void SendSMSMessageShouldReturnSMSMessageResource() { var account = new TwilioAccountMock(); var phoneAutomation = new PhoneAutomation(account); var message = phoneAutomation.SendSMSMessage("Test_From", "Test_To", "Test_body"); Assert.IsNotNull(message); }
public void DeleteProvisionedPhoneNumberWithNullObjectShouldReturnArgumentNullException() { try { var account = new TwilioAccountMock(); var phoneAutomation = new PhoneAutomation(account); phoneAutomation.DeleteProvisionedPhoneNumber(null); } catch (System.Exception ex) { Assert.IsInstanceOfType(ex, typeof(System.ArgumentNullException)); } }
public void DeleteProvisionedPhoneNumberWithValidPhoneObjectShouldReturnNullBody() { var account = new TwilioAccountMock(); var phoneAutomation = new PhoneAutomation(account); var phoneNumber = new PhoneNumber{ sid = "1", phone_number = "1" }; phoneAutomation.DeleteProvisionedPhoneNumber(phoneNumber); }
public void IncomingPhoneNumbersWithNowParametersShouldThrowNullReferenceError() { try { var account = new TwilioAccountMock(); var phoneAutomation = new PhoneAutomation(account); phoneAutomation.IncomingPhoneNumbers(); Assert.Fail("Cannot call this method without params"); } catch (System.Exception ex) { Assert.IsInstanceOfType(ex, typeof(System.ArgumentNullException)); Assert.IsTrue(ex.Message.Contains("missing phoneNumber")); } }
public void IncomingPhoneNumbersByFriendlyNameShouldReturnListOfPhoneNumbers() { var account = new TwilioAccountMock(); var phoneAutomation = new PhoneAutomation(account); var numbers = phoneAutomation.IncomingPhoneNumbers(phoneNumber: "555-555-5555", friendlyName: "test"); Assert.IsNotNull(numbers); }