public void SendSMS(string from, string number, string text)
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest
                                     .Create(makeBytehandGetRequestURL(_smsSettings.ServiceId, _smsSettings.ServiceKey,
                                                                       _numberFormatter.FormatNumber(number), from, text));

            WebResponse response = null;

            try
            {
                response = request.GetResponse();
            }
            finally
            {
                if (response != null)
                {
                    response.Dispose();
                }
            }
        }
示例#2
0
 public void FormatNumberTest()
 {
     formatter.FormatNumber("9788111703").ShouldEqual <string>("+79788111703");
     formatter.FormatNumber("+7(978) 8111 703").ShouldEqual <string>("+79788111703");
     formatter.FormatNumber("+79788111703").ShouldEqual <string>("+79788111703");
 }