Ejemplo n.º 1
0
 public BSGSmsService(SmsServiceConfiguration configuration)
 {
     if (configuration.ServiceName != SmsServiceTypes.BSG)
     {
         throw new ArgumentException($"{nameof(SmsServiceConfiguration.ServiceName)} should be {SmsServiceTypes.BSG}.", nameof(configuration));
     }
     _configuration = (BSGServiceConfiguration)configuration;
 }
Ejemplo n.º 2
0
        public async Task BSGSendSmsTest()
        {
            SmsServiceConfiguration configuration = new BSGServiceConfiguration
            {
                ApiKey      = "live_dB92BUU13zBbQ77MVSHH",
                SenderName  = "SERVIX.io",
                ServiceUrl  = "https://app.bsg.hk/rest/sms",
                ServiceName = SmsServiceTypes.BSG
            };
            ISmsService service = new BSGSmsService(configuration);

            Assert.True(await service.SendAsync("79131743886", "Verification code: 6563"));
        }