public void EmailService_ShouldRun_UnitTestTemplate() { // Arrange UnitTestTemplateModel model = new UnitTestTemplateModel { Username = "******" }; // Act string expected = UnitTestEmailTemplate.FormatWith(model.Username); ITemplate template = templateService.Resolve("UnitTest", model); string result = template.Run(); // Assert Assert.AreEqual(expected, result); }
public void EmailService_ShouldRenderLayoutsFromSameAssembly() { // Arrange UnitTestTemplateModel model = new UnitTestTemplateModel { Username = "******" }; // Act string expected = "[{0}]".FormatWith(UnitTestEmailTemplate).FormatWith(model.Username); ITemplate template = templateService.Resolve("UnitTestLayout", model); string result = template.Run(); // Assert Assert.AreEqual(expected, result); }
public void EmailService_ShouldRenderLayoutWithSections() { // Arrange UnitTestTemplateModel model = new UnitTestTemplateModel { Username = "******" }; // Act string body = UnitTestDeclaration; string section = UnitTestNotice.FormatWith(model.Username); string expected = "[\r\n{0}\r\n\r\n\r\n]\r\n{{\r\n\r\n {1}\r\n\r\n}}".FormatWith(body, section); ITemplate template = templateService.Resolve("UnitTestLayoutSection", model); string result = template.Run(); // Assert Assert.AreEqual(expected, result); }