Inheritance: IPhoneAutomation
Ejemplo n.º 1
0
        public void AvailableLocalPhoneNumbersByAreaCodeShouldReturnAvailablePhoneNumbersList()
        {
            var account = new TwilioAccountMock();
            var phoneAutomation = new PhoneAutomation(account);
            var availablePhoneNumbers = phoneAutomation.AvailableLocalPhoneNumbers(1);

            Assert.IsNotNull(availablePhoneNumbers);
        }
Ejemplo n.º 2
0
        public void AvailableTollFreePhoneNumbersShouldReturnAvailablePhoneNumbersList()
        {
            var account = new TwilioAccountMock();
            var phoneAutomation = new PhoneAutomation(account);
            var availablePhoneNumbers = phoneAutomation.AvailableTollFreePhoneNumbers();

            Assert.IsNotNull(availablePhoneNumbers);
        }
Ejemplo n.º 3
0
        public void CreateSubAccountReturnsNewAccountResource()
        {
            var account = new TwilioAccountMock();
            var phoneAutomation = new PhoneAutomation(account);
            var twilioAccount = phoneAutomation.CreateSubAccount("My new account test");

            Assert.IsNotNull(twilioAccount);
        }
Ejemplo n.º 4
0
        public void GetSubAccountsReturnsAccountListResource()
        {
            var account = new TwilioAccountMock();
            var phoneAutomation = new PhoneAutomation(account);
            var accounts = phoneAutomation.GetSubAccounts();

            Assert.IsNotNull(accounts);
        }
Ejemplo n.º 5
0
        public void ProvisionNumberShouldReturnNewNumberResource()
        {
            var account = new TwilioAccountMock();
            var phoneAutomation = new PhoneAutomation(account);
            var number = phoneAutomation.ProvisionPhoneNumber("555-555-5555");

            Assert.IsNotNull(number);
        }
Ejemplo n.º 6
0
        public void SMSListShouldReturnListOfSMSResources()
        {
            var account = new TwilioAccountMock();
            var phoneAutomation = new PhoneAutomation(account);
            var smsList = phoneAutomation.SMSMessageList();

            Assert.IsNotNull(smsList);
            Assert.IsNotNull(smsList.sms_messages);
        }
Ejemplo n.º 7
0
        public void FetchingSMSResourceByIdShouldReturnSMSResource()
        {
            var account = new TwilioAccountMock();
            var phoneAutomation = new PhoneAutomation(account);
            var sms = phoneAutomation.GetSMSMessage("fake_guid"); //some random guid

            Assert.IsNotNull(sms);
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        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));
            }
        }
Ejemplo n.º 10
0
        public void DeleteProvisionedPhoneNumberWithValidPhoneObjectShouldReturnNullBody()
        {
            var account = new TwilioAccountMock();
            var phoneAutomation = new PhoneAutomation(account);

            var phoneNumber = new PhoneNumber{
                sid = "1", phone_number = "1"
            };
            phoneAutomation.DeleteProvisionedPhoneNumber(phoneNumber);
        }
Ejemplo n.º 11
0
 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"));
     }
 }
Ejemplo n.º 12
0
        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);
        }