Example #1
0
        public async Task Send_ReceivedInvoiceEmail_SuccessfullyAsync()
        {
            // Arrange
            var settings = new ReceivedInvoiceEmailSettings
            {
                DocumentId      = 165292,
                ReportLanguage  = Language.De,
                EmailBody       = "Test ReceivedInvoice email.",
                EmailSubject    = "ReceivedInvoice",
                SendToSelf      = true,
                OtherRecipients = new List <string> {
                    OtherEmail
                }
            };

            // Act
            var response = await MailClient.ReceivedInvoiceEmail.SendAsync(settings);

            var result = response.AssertResult();

            // Assert
            Assert.IsTrue(result.Sent.Contains(MyEmail));
            Assert.IsTrue(!result.NotSent.Any());
        }
Example #2
0
        public void Send_ReceivedInvoiceEmailWithoutRecipient_ThrowsValidationException(ReceivedInvoiceEmailSettings setting)
        {
            var exception = Assert.ThrowsAsync <ValidationException>(() => DokladApi.MailClient.ReceivedInvoiceEmail.SendAsync(setting));

            AssertExceptionMessage(exception);
        }
Example #3
0
 /// <inheritdoc/>
 public Task <ApiResult <EmailSendResult> > SendAsync(ReceivedInvoiceEmailSettings settings, CancellationToken cancellationToken = default)
 {
     return(SendAsync <ReceivedInvoiceEmailSettings>(settings, cancellationToken));
 }