public void ShouldSendMailWithOptionalProperties() { //Given var expectedMail = new ExpectedMail("*****@*****.**", "*****@*****.**", "test mail", "test mail body"); //optional properties expectedMail.ccRecipient = "*****@*****.**"; expectedMail.replyTo = "*****@*****.**"; var job = new TestSendMailJob(); var context = TestUtil.NewJobExecutionContextFor(job); context.MergedJobDataMap.Put("smtp_host", "someserver"); context.MergedJobDataMap.Put("recipient", expectedMail.recipient); context.MergedJobDataMap.Put("cc_recipient", expectedMail.ccRecipient); context.MergedJobDataMap.Put("sender", expectedMail.sender); context.MergedJobDataMap.Put("reply_to", expectedMail.replyTo); context.MergedJobDataMap.Put("subject", expectedMail.subject); context.MergedJobDataMap.Put("message", expectedMail.message); //When job.Execute(context); //Then expectedMail.IsEqualTo(job.actualMailSent); Assert.AreEqual("someserver", job.actualSmtpHost); }
public void ShouldSendMailWithOptionalProperties() { //Given ExpectedMail expectedMail = new ExpectedMail("*****@*****.**", "*****@*****.**", "test mail", "test mail body"); //optional properties expectedMail.CcRecipient = "*****@*****.**"; expectedMail.ReplyTo = "*****@*****.**"; TestSendMailJob job = new TestSendMailJob(); JobExecutionContext context = TestUtil.NewJobExecutionContextFor(job); context.JobDetail.JobDataMap.Put("smtp_host", "someserver"); context.JobDetail.JobDataMap.Put("recipient", expectedMail.Recipient); context.JobDetail.JobDataMap.Put("cc_recipient", expectedMail.CcRecipient); context.JobDetail.JobDataMap.Put("sender", expectedMail.Sender); context.JobDetail.JobDataMap.Put("reply_to", expectedMail.ReplyTo); context.JobDetail.JobDataMap.Put("subject", expectedMail.Subject); context.JobDetail.JobDataMap.Put("message", expectedMail.Message); //When job.Execute(context); //Then expectedMail.IsEqualTo(job.ActualMailSent); Assert.That(job.ActualSmtpHost, Is.EqualTo("someserver")); }
public void ShouldSendMailWithOptionalProperties() { //Given var expectedMail = new ExpectedMail("*****@*****.**", "*****@*****.**", "test mail", "test mail body"); //optional properties expectedMail.ccRecipient = "*****@*****.**"; expectedMail.replyTo = "*****@*****.**"; var job = new TestSendMailJob(); var context = TestUtil.NewJobExecutionContextFor(job); context.MergedJobDataMap.Put("smtp_host", "someserver"); context.MergedJobDataMap.Put("recipient", expectedMail.recipient); context.MergedJobDataMap.Put("cc_recipient", expectedMail.ccRecipient); context.MergedJobDataMap.Put("sender", expectedMail.sender); context.MergedJobDataMap.Put("reply_to", expectedMail.replyTo); context.MergedJobDataMap.Put("subject", expectedMail.subject); context.MergedJobDataMap.Put("message", expectedMail.message); //When job.Execute(context); //Then expectedMail.IsEqualTo(job.actualMailSent); Assert.AreEqual("someserver", job.actualSmtpHost); }
public void ShouldSendMailWithMandatoryProperties() { //Given var expectedMail = new ExpectedMail("*****@*****.**", "*****@*****.**", "test mail", "test mail body"); var job = new TestSendMailJob(); var context = TestUtil.NewJobExecutionContextFor(job); context.JobDetail.JobDataMap.Put("smtp_host", "someserver"); context.JobDetail.JobDataMap.Put("recipient", expectedMail.recipient); context.JobDetail.JobDataMap.Put("sender", expectedMail.sender); context.JobDetail.JobDataMap.Put("subject", expectedMail.subject); context.JobDetail.JobDataMap.Put("message", expectedMail.message); //When job.Execute(context); //Then expectedMail.IsEqualTo(job.actualMailSent); Assert.AreEqual("someserver", job.actualSmtpHost); }
public void ShouldSendMailWithMandatoryProperties() { //Given var expectedMail = new ExpectedMail("*****@*****.**", "*****@*****.**", "test mail", "test mail body"); var job = new TestSendMailJob(); var context = TestUtil.NewJobExecutionContextFor(job); context.JobDetail.JobDataMap.Put("smtp_host", "someserver"); context.JobDetail.JobDataMap.Put("recipient", expectedMail.recipient); context.JobDetail.JobDataMap.Put("sender", expectedMail.sender); context.JobDetail.JobDataMap.Put("subject", expectedMail.subject); context.JobDetail.JobDataMap.Put("message", expectedMail.message); //When job.Execute(context); //Then expectedMail.IsEqualTo(job.actualMailSent); Assert.AreEqual("someserver", job.actualSmtpHost); }