public void SendTextMessageTest() { var target = new RemindrController(); var request = new SendTextMessageRequest { SendTo = ConfigurationManager.AppSettings["TestMobileNumber"], TextMessage = "integration test" }; var actual = target.SendTextMessage(request); const bool expected = true; Assert.AreEqual(expected, ((Response)actual.Data).Success); }
public void SendTextMessageTest() { var target = new RemindrController(); var request = new SendTextMessageRequest { SendTo = "+447590488120", TextMessage = "integration test" }; var actual = target.SendTextMessage(request); const bool expected = true; Assert.AreEqual(expected, ((Response)actual.Data).Success); }
public JsonResult SendTextMessage(SendTextMessageRequest request) { var response = new Response{ Success = true }; var textService = new TextService(); try { textService.SendMessage(request.SendTo, request.TextMessage); } catch (Exception e) { response.Success = false; } return Json(response, JsonRequestBehavior.AllowGet); }