public async Task SendSmsWithoutParametersShouldThrowException() { ISmsNotification emptySmsNotification = null; var source = new Mock <ISmsSender>(); TwilioSmsConfiguration emptyConfig = new TwilioSmsConfiguration(); var mockSmsService = new SmsNotificationService(source.Object); await Assert.ThrowsAsync <ArgumentNullException>(() => mockSmsService.SendAsync(emptySmsNotification)); }
public async Task GetStatusTest() { var service = new SmsNotificationService { Authentication = _textFixture.Authentication, Username = _textFixture.MainApiUsername, Password = _textFixture.MainApiPassword, SenderId = _textFixture.MainApiSenderId }; await service.GetStatus("ENTER-MESSAGE-ID-HERE"); }
public async Task SendMessageTest() { var service = new SmsNotificationService { Authentication = _textFixture.Authentication, Username = _textFixture.MainApiUsername, Password = _textFixture.MainApiPassword, SenderId = _textFixture.MainApiSenderId }; await service.SendMessage("ENTER-NUMBER-HERE", "ENTER-MESSAGE-CONTENT-HERE"); }
private static async Task RunExample() { ISmsNotificationService service = new SmsNotificationService { Authentication = new KeyAuthentication(Environment.GetEnvironmentVariable("APIKEY")) }; var result = await service.SendMessage("082298968201", "Halo test BigBoxNet."); Console.WriteLine("Code: {0}", result.Code); Console.WriteLine("Message ID: {0}", result.MessageId); Console.WriteLine("Message: {0}", result.Message); Console.WriteLine("Status: {0}", result.Status); }
public async Task SendSmsNotification() { var smsSender = new TwilioSmsSender(_smsConfiguration.Configuration, _smsConfiguration.TwilioRestClient); var smsService = new SmsNotificationService(smsSender); var recipients = new List <string>() { _smsConfiguration.RecipientPhoneNumber }; var sms = new BaseSmsNotification() { Text = SmsText, RecipientPhoneNumbers = recipients }; await smsService.SendAsync(sms); }
public ReviewsController(IReviewDao reviewDao, EmailNotificationService emailService, SmsNotificationService smsService) { _dao = reviewDao; _emailNotificationService = emailService; _smsNotificationService = smsService; }