static void Main(string[] args) { TwilioWrapper wrapper = new TwilioWrapper("+86 131 3051 1523", "ACa5a21802beff96f147d40bf98c957038", "7852c807435af28d468344ca57a49d2a", "+1 754-333-6811"); Console.WriteLine("Call sid: " + wrapper.call()); Console.ReadLine(); }
public void Sending() { var twilioResponse = new SMSMessage { Status = "sending", Sid = "sidReceipt" }; var response = TwilioWrapper.ProcessResponse(twilioResponse); Assert.That(response, Is.TypeOf(typeof(SmsSending))); Assert.That(response.Sid, Is.EqualTo(response.Sid)); }
public void Success() { var twilioResponse = new SMSMessage { Status = "sent", Sid = "sidReceipt", DateSent = DateTime.Now, Price = 3 }; var response = TwilioWrapper.ProcessResponse(twilioResponse); Assert.That(response, Is.TypeOf(typeof(SmsSent))); Assert.That(response.Sid, Is.EqualTo(response.Sid)); var smsSent = response as SmsSent; Assert.That(smsSent.SmsConfirmationData.Receipt, Is.EqualTo(twilioResponse.Sid)); Assert.That(smsSent.SmsConfirmationData.SentAtUtc, Is.EqualTo(twilioResponse.DateSent)); Assert.That(smsSent.SmsConfirmationData.Price, Is.EqualTo(twilioResponse.Price)); }
public void FailedRestException() { var twilioResponse = new SMSMessage { RestException = new RestException { Code = "code", Message = "message", MoreInfo = "moreInfo", Status = "status" } }; var response = TwilioWrapper.ProcessResponse(twilioResponse); Assert.That(response, Is.TypeOf(typeof(SmsFailed))); Assert.That(response.Sid, Is.EqualTo(twilioResponse.Sid)); var smsFailed = response as SmsFailed; Assert.That(smsFailed.Status, Is.EqualTo(twilioResponse.RestException.Status)); Assert.That(smsFailed.Code, Is.EqualTo(twilioResponse.RestException.Code)); Assert.That(smsFailed.Message, Is.EqualTo(twilioResponse.RestException.Message)); Assert.That(smsFailed.MoreInfo, Is.EqualTo(twilioResponse.RestException.MoreInfo)); }