Ejemplo n.º 1
0
        public void DoExecuteTest2()
        {
            EmailTasklet tasklet = new EmailTasklet();

            SetupTasklet(tasklet, 30);
            tasklet.AfterPropertiesSet();
            Assert.IsTrue(tasklet.DoExecute());
        }
Ejemplo n.º 2
0
 private static void SetupTasklet(EmailTasklet tasklet, int lineLength)
 {
     tasklet.Username   = "******";
     tasklet.Password   = "******";
     tasklet.Encoding   = Encoding.UTF8;
     tasklet.From       = "*****@*****.**";
     tasklet.To         = new[] { "*****@*****.**" };
     tasklet.Cc         = new[] { "*****@*****.**" };
     tasklet.Bcc        = new[] { "*****@*****.**" };
     tasklet.Host       = "srvXXXX.xxx";
     tasklet.Subject    = "EmailTasklet test; please do not respond, this is an automatically sent email.";
     tasklet.Body       = new FileSystemResource(@"TestData\Email\sampleMailBody.txt");
     tasklet.LineLength = lineLength;
 }
Ejemplo n.º 3
0
        public void AfterPropertiesSetTest()
        {
            EmailTasklet tasklet = new EmailTasklet();

            try
            {
                tasklet.AfterPropertiesSet();
            }
            catch (Exception e)
            {
                Assert.IsTrue(e is ArgumentException);
            }
            SetupTasklet(tasklet, 0);

            tasklet.AfterPropertiesSet();
            Assert.IsNotNull(tasklet);
        }