示例#1
0
        public void CreateNumberLookupTestNull()
        {
            //Arrange
            string[] numbers = null;
            Twizo    twizo   = new Twizo(apiKey, apiHost);

            //Act
            var lookup = twizo.CreateNumberLookup(numbers);

            //Assert
            Assert.AreEqual(lookup.numbers, numbers);
        }
示例#2
0
        public void GetNumberLookupTest()
        {
            //Arrange
            string recipient = "601151174973";
            Twizo  twizo     = new Twizo(apiKey, apiHost);

            //Act
            var lookup = twizo.CreateNumberLookup(recipient);

            lookup.Send();
            string messageId = lookup.messageId;
            var    newLookup = twizo.GetNumberLookup(messageId);

            //Assert
            Assert.AreEqual(lookup.messageId, newLookup.messageId);
        }
示例#3
0
        public void Send()
        {
            Twizo twizo  = new Twizo(this.apiKey, this.apiHost);
            var   lookup = twizo.CreateNumberLookup(numbers);

            if (this.tag != "")
            {
                lookup.tag = this.tag;
            }
            lookup.validity   = this.validity;
            lookup.resultType = this.resultType;
            if (this.callbackUrl != "")
            {
                lookup.callbackUrl = this.callbackUrl;
            }

            lookup.Send();
            LogResponse(lookup);
            this.messageId = lookup.messageId;
        }