Ejemplo n.º 1
0
 private static void SetDefaultClickatellClient(ClickatellConfigFileSettings clickatellConfigFileSettings,
     ConfigurationExpression x)
 {
     var clickatellClient = new ClickatellClient(clickatellConfigFileSettings);
     x.For<ClickatellClient>()
         .Use(new IgnoreAuthErrorClickatellClient(clickatellConfigFileSettings,
             new IgnoreNoCreditErrorClickatellClient(clickatellConfigFileSettings, clickatellClient)));
 }
Ejemplo n.º 2
0
        public async Task TestSendSms()
        {
            var client   = new ClickatellClient(new SmsKit.Data.RESTCredentials("1NddRb4U6If7rSKAiVRkUXvLCUM31VTLloXNWAQBYyC1oDgVxfcTdmpHTzMcAduVE3mPhEPvnbiAX1"));
            var response = await client.SendMessageAsync(new SmsKit.Data.SendMessageRequest("test message", "8613921198852"));

            Assert.True(response.Success);

            await Assert.ThrowsAnyAsync <SmsKitException>(async() => await client.SendMessageAsync(new SmsKit.Data.SendMessageRequest("test message", "13921198852")));
        }
Ejemplo n.º 3
0
        public override sealed void OnVirtualWork()
        {
            try
            {
                var message = Execute();

                if (message != null)
                {
                    var smsService = new ClickatellClient();
                    smsService.Send(message.RecipientNumber, message.MessageContent);
                }
                else throw new ClickatellException(string.Format("The return result for the execution of {0} of type {1} can not be null.", this, typeof(CloudClickatellActivity)));
            }
            catch (Exception ex)
            {
                HandleException(ex);
            }
        }