public void SetValueObjectToNull() { TemplatedMailMessage email = new TemplatedMailMessage(@"Net\Mail\NoComments.tpl"); email.Merge(new TestClass()); email.Merge(null); }
public void ConstructorsTest() { TemplatedMailMessage email = new TemplatedMailMessage(@"Net\Mail\NoComments.tpl", "*****@*****.**", "*****@*****.**"); Assert.AreEqual(@"Net\Mail\NoComments.tpl", email.Content); Assert.AreEqual("*****@*****.**", email.From.Address); Assert.AreEqual(1, email.To.Count); Assert.AreEqual("*****@*****.**", email.To[0].Address); }
public void MultiLineCommentsTest() { TemplatedMailMessage email = new TemplatedMailMessage(@"Net\Mail\MultiLineComments.tpl"); email.Merge(new TestClass()); Assert.IsNotNull(email.Body); Assert.IsNotEmpty(email.Body); Assert.AreEqual(TestClass.ExpectedContent, email.Body); }
public void GetMergeValuesTest() { TemplatedMailMessage email = new TemplatedMailMessage(@"Net\Mail\NoComments.tpl"); email.Subject = "Test"; email.Merge(new TestClass()); Assert.IsNotNull(email.GetMergeValue("FullName")); Assert.AreEqual("Ben Jammin", email.GetMergeValue("FullName")); Assert.IsNotNull(email.GetMergeValue("Link")); Assert.AreEqual("www.thesite.com/activate?uid=s87df87at827gf4f7g78fg34", email.GetMergeValue("Link")); }
public void LayoutTemplateTest() { TemplatedMailMessage email = new TemplatedMailMessage(@"Net\Mail\TemplateContent.tpl"); email.Layout = @"Net\Mail\TemplateLayout.tpl"; email.AddTemplate("Header", "Hello {{FullName}}"); email.AddTemplate("Footer", "Thank You,<br/><br/>The Team<br/><br/>*This is a disclaimer."); email.Merge(new TestClass()); Assert.IsNotNull(email.Body); Assert.IsNotEmpty(email.Body); Assert.AreEqual(TestClass.ExpectedContentWithLayout, email.Body); }
public void AnonymousClassValues() { TemplatedMailMessage email = new TemplatedMailMessage(@"Net\Mail\NoComments.tpl"); email.Subject = "Test"; email.Merge(new { FullName = "Ben Jammin", Link = "www.thesite.com/activate?uid=s87df87at827gf4f7g78fg34" }); Assert.IsNotNull(email.Body); Assert.IsNotEmpty(email.Body); Assert.AreEqual(TestClass.ExpectedContent, email.Body); }
public void MemberSetTest() { TemplatedMailMessage email = new TemplatedMailMessage(@"Net\Mail\NoComments.tpl"); TestClass mergeObject = new TestClass(); email.From = new MailAddress("*****@*****.**"); email.To.Add("*****@*****.**"); email.Merge(mergeObject); Assert.AreEqual(@"Net\Mail\NoComments.tpl", email.Content); Assert.AreSame(mergeObject, email.MergeObject); Assert.IsNotNull(email.Body); Assert.IsNotEmpty(email.Body); Assert.AreEqual(TestClass.ExpectedContent, email.Body); }