public BSGSmsService(SmsServiceConfiguration configuration) { if (configuration.ServiceName != SmsServiceTypes.BSG) { throw new ArgumentException($"{nameof(SmsServiceConfiguration.ServiceName)} should be {SmsServiceTypes.BSG}.", nameof(configuration)); } _configuration = (BSGServiceConfiguration)configuration; }
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")); }