Ejemplo n.º 1
0
        public void UsernamerReplacedInSubject(string template, string username, string expected)
        {
            // Setup
            _accountDeleteEmailBuilder.Setup(adeb => adeb.GetSubject())
            .Returns(template);

            var disposableBuilder = new DisposableEmailBuilder(_accountDeleteEmailBuilder.Object, new EmailRecipients(new List <MailAddress>()), username);

            // Act
            var result = disposableBuilder.GetSubject();

            // Assert
            Assert.Equal(expected, result);
        }
Ejemplo n.º 2
0
        public void UsernamerReplacedInBody(string template, string username, string expected)
        {
            // Setup
            _accountDeleteEmailBuilder.Setup(adeb => adeb.GetBody(It.IsAny <EmailFormat>()))
            .Returns(template);

            var disposableBuilder = new DisposableEmailBuilder(_accountDeleteEmailBuilder.Object, new EmailRecipients(new List <MailAddress>()), username);

            // Act
            var resultHtml      = disposableBuilder.GetBody(EmailFormat.Html);
            var resultMarkdown  = disposableBuilder.GetBody(EmailFormat.Markdown);
            var resultPlainText = disposableBuilder.GetBody(EmailFormat.PlainText);

            // Assert
            Assert.Equal(expected, resultHtml);
            Assert.Equal(expected, resultMarkdown);
            Assert.Equal(expected, resultPlainText);
        }