public async Task CreateMessagingMultiFactorReturnsOk() { var accountId = TestConstants.AccountId; var applicationId = TestConstants.MessagingApplicationId; var to = TestConstants.To; var from = TestConstants.From; var scope = "test"; var digits = 6; var message = "Your temporary {NAME} {SCOPE} code is {CODE}"; var request = new TwoFactorCodeRequestSchema { ApplicationId = applicationId, To = to, From = from, Scope = scope, Digits = digits, Message = message }; var response = await _client.MultiFactorAuth.MFAController.CreateMessagingTwoFactorAsync(accountId, request); Assert.Equal(200, response.StatusCode); Assert.NotEmpty(response.Data.MessageId); }
public async Task CreateMessagingMultiFactorInvalidFromPhoneNumberThrows() { var accountId = TestConstants.AccountId; var applicationId = TestConstants.MessagingApplicationId; var to = TestConstants.To; var from = "invalid"; var scope = "test"; var digits = 6; var message = "Your temporary {NAME} {SCOPE} code is {CODE}."; var request = new TwoFactorCodeRequestSchema { ApplicationId = applicationId, To = to, From = from, Scope = scope, Digits = digits, Message = message }; var ex = await Assert.ThrowsAsync <ErrorWithRequestException>(() => _client.MultiFactorAuth.MFAController.CreateMessagingTwoFactorAsync(accountId, request)); Assert.Equal("If there is any issue with values passed in by the user", ex.Message); }