public void GetSmsSendStatusForRecipientTest() { var smsDefinition = CreateSmsDefinitionObject(); var createSmsDefinitionResult = transactionalMessagingApiClient.CreateSmsDefinition(smsDefinition); var smsToSendToRecipientKey = createSmsDefinitionResult.DefinitionKey; var recipient = new Recipient("*****@*****.**"); var messageKey = Guid.NewGuid().ToString(); var messageRequestBody = new SendSmsToSingleRecipientRequest(smsToSendToRecipientKey, recipient); transactionalMessagingApiClient.SendSmsToSingleRecipient(messageKey, messageRequestBody); var getSmsSendStatusForRecipientResult = transactionalMessagingApiClient.GetSmsSendStatusForRecipient(messageKey); try { Assert.NotNull(getSmsSendStatusForRecipientResult.RequestId); Assert.NotNull(getSmsSendStatusForRecipientResult.Timestamp); var eventCategoryTypes = new Collection <string>() { "TransactionalSendEvents.SMSSent", "TransactionalSendEvents.SMSQueued", "TransactionalSendEvents.SMSNotSent" }; CollectionAssert.Contains(eventCategoryTypes, getSmsSendStatusForRecipientResult.EventCategoryType); } finally { transactionalMessagingApiClient.DeleteSmsDefinition(smsToSendToRecipientKey); } }
public void SendSmsToSingleRecipientTest() { var smsDefinition = CreateSmsDefinitionObject(); var createSmsDefinitionResult = transactionalMessagingApiClient.CreateSmsDefinition(smsDefinition); var smsToSendToRecipientKey = createSmsDefinitionResult.DefinitionKey; var recipient = new Recipient("*****@*****.**"); var messageKey = Guid.NewGuid().ToString(); var messageRequestBody = new SendSmsToSingleRecipientRequest(smsToSendToRecipientKey, recipient); var sendSmsToSingleRecipientResult = transactionalMessagingApiClient.SendSmsToSingleRecipient(messageKey, messageRequestBody); try { Assert.NotNull(sendSmsToSingleRecipientResult.RequestId); Assert.NotNull(sendSmsToSingleRecipientResult.Errorcode); Assert.NotNull(sendSmsToSingleRecipientResult.Responses); } finally { transactionalMessagingApiClient.DeleteSmsDefinition(smsToSendToRecipientKey); } }