public static async Task SendEmailAsync_MessageHasExpectedFormatItems() { object[] formatItems = { 1, "2" }; var service = new MockEmailService(); var template = new EmailMessageTemplate(new EmailAddressTemplate("*****@*****.**")); await service.SendEmailAsync(template, new EmailAddress("*****@*****.**"), formatItems); service.SentMessage.HtmlBody !.FormatItems.Should().BeEquivalentTo(formatItems); service.SentMessage.TextBody !.FormatItems.Should().BeEquivalentTo(formatItems); }
public static async Task SendEmailAsync_MessageHasExpectedRecipient() { var recipient = new EmailAddress("*****@*****.**"); var service = new MockEmailService(); var template = new EmailMessageTemplate(new EmailAddressTemplate("*****@*****.**")); await service.SendEmailAsync(template, recipient); service.SentMessage.Recipients.Should().HaveCount(1); service.SentMessage.Recipients[0].Should().BeSameAs(recipient); }
public static async Task SendEmailAsync_UsesMessageTemplate() { // ReSharper disable once StringLiteralTypo const string subject = "Banitsa"; var service = new MockEmailService(); var template = new EmailMessageTemplate(new EmailAddressTemplate("*****@*****.**")) { Subject = subject, }; await service.SendEmailAsync(template, new EmailAddress("*****@*****.**")); service.SentMessage.Subject.Should().Be(subject); }