public void MessageSignatureReader_ReadEmailTemplate_Should_ReadTheWelcomeEmailTemplate() { var config = new Config(); var messageTemplateReader = new MessageTemplateReader(config.MessagesTemplatesRootDirectory); var messageSignatureReader = new MessageSignatureReader(messageTemplateReader); var signature = messageSignatureReader.Read(); Assert.IsNotNull(signature); Assert.IsTrue(signature.IndexOf("[SIGNATURE]", StringComparison.Ordinal) > -1); }
public void MessageTemplateReader_ReadEmailTemplate_Should_ReadTheWelcomeEmailTemplate() { var config = new Config(); const string templateName = "welcome"; var messageTemplateReader = new MessageTemplateReader(config.MessagesTemplatesRootDirectory); var templateContent = messageTemplateReader.Read(templateName); Assert.IsNotNull(templateContent); Assert.IsTrue(templateContent.IndexOf("Welcome", StringComparison.Ordinal) > -1); }
public void MessageBodyCreator_Create_Should_CreateWelcomeMessageBody() { var config = new Config(); const string templateName = "welcome"; var messageTemplateReader = new MessageTemplateReader(config.MessagesTemplatesRootDirectory); var messageSignatureReader = new MessageSignatureReader(messageTemplateReader); var messageBodyCreator = new MessageBodyCreator(messageTemplateReader, messageSignatureReader); var messageBody = messageBodyCreator.Create(templateName); Assert.IsNotNull(messageBody); Assert.IsTrue(messageBody.IndexOf("Welcome", StringComparison.Ordinal) > -1); }
public void MessageBodyCreator_Create_Should_CreateResetPasswordMessage() { var config = new Config(); const string templateName = "reset-password"; const string placeholderValue = "https://thenewlink.com"; var messageTemplateReader = new MessageTemplateReader(config.MessagesTemplatesRootDirectory); var messageSignatureReader = new MessageSignatureReader(messageTemplateReader); var placeholdersReplacer = new PlaceholdersReplacer(); var messageBodyCreator = new MessageBodyCreator(messageTemplateReader, messageSignatureReader, placeholdersReplacer); var placeholdersWithValues = new Dictionary <string, string> { { "link", placeholderValue } }; var messageBody = messageBodyCreator.Create(templateName, placeholdersWithValues); Assert.IsNotNull(messageBody); Assert.IsTrue(messageBody.IndexOf("reset your password", StringComparison.Ordinal) > -1); }