public void must_generate_html_body_with_links() { var data = new SimpleEmailDataModel() { Name = "Alex", Param = "123" }; var generator = new RazorMessageBodyGenerator(); var template = "<html><head><title>Hello @Model.Name</title></head><body>Click <a href='http://domain.com/@Model.Param/234'>here</a></body></html>"; var result = generator.Generate(template, data); Assert.AreEqual("<html><head><title>Hello Alex</title></head><body>Click <a href='http://domain.com/123/234'>here</a></body></html>", result); }
public void must_generate_plain_text_body() { var data = new SimpleEmailDataModel() { Name = "Alex" }; var generator = new RazorMessageBodyGenerator(); var template = "Hello @Model.Name!"; var result = generator.Generate(template, data); Assert.AreEqual("Hello Alex!", result); }
public void must_generate_html_body() { var data = new SimpleEmailDataModel() { Name = "Alex" }; var generator = new RazorMessageBodyGenerator(); var template = "<html><head><title>Hello @Model.Name</title></head><body>Sample body</body></html>"; var result = generator.Generate(template, data); Assert.AreEqual("<html><head><title>Hello Alex</title></head><body>Sample body</body></html>", result); }