using Centron.BusinessLogic; using Centron.BusinessLogic.Mail.Factory; using Centron.BusinessLogic.WebServices.Mail; using Centron.Data.WebServices.Mail; using Centron.Interfaces.Mail.Enums; using Centron.Tests.EndToEnd.Infrastructure; using Xunit.Abstractions; namespace Centron.Tests.EndToEnd.Tests.Mails; public class TestMailsTest : EndToEndTest { public TestMailsTest(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } public override void Execute() { var mails = TestMails.Start(() => { this.SendMail("Betreff", "HalloWelt", "to@c-entron.de", "cc@c-entron.de", "bcc@c-entron.de"); this.SendMail("Another one!", "Hallo Universe", "to@c-entron.de", "cc@c-entron.de", "bcc@c-entron.de"); }); this.Verifier.Verify("SentMails", mails); } private void SendMail(string subject, string body, string to, string cc, string bcc) { using var session = new BLSession(); session.GetBL().SendMail( this.GetLoggedInUser(), new[] { new MailRecipientDTO { RecipientAddress = to } }, new[] { new MailRecipientDTO { RecipientAddress = cc } }, new[] { new MailRecipientDTO { RecipientAddress = bcc } }, new MailSubjectDTO { SubjectText = subject }, new MailBodyDTO { Type = CentronMailBodyType.Plain, Text = body }, new MailAttachmentDTO[0], generateCRM: null, kinds: null, settingsKind: null); } }