示例#1
0
        public void Test_SendMail_Smtp_problem()
        {
            // Arrange
            Logger         log    = new Logger("Mailsend_path2.log");
            FakeMailSender sender = new FakeMailSender("MailSmtpHost", "onetwo", log); // smtp is the key, if we can init it, we can send a mail.

            // Act
            bool result = sender.SendEmail("*****@*****.**", "testing", "testbody", null);

            // Assert
            Assert.AreEqual(false, result);
        }
示例#2
0
        public void Test_SendMail_Attachment()
        {
            // Arrange
            Logger         log    = new Logger("Mailsend_path3.log");
            FakeMailSender sender = new FakeMailSender("MailSmtpHost", "1234", log);

            // Act
            bool result = sender.SendEmail("*****@*****.**", "testing", "testbody", "File.csv");

            // Assert
            Assert.AreEqual(true, result);
        }
示例#3
0
        public void Test_SendMail_Right()
        {
            // Arrange
            Logger         log    = new Logger("Mailsend_path1.log");
            FakeMailSender sender = new FakeMailSender("MailSmtpHost", "1234", log);

            // Act
            bool result = sender.SendEmail("*****@*****.**", "testing", "testbody", null); // if every value are right, so it can send a mail.

            // Assert
            Assert.AreEqual(true, result);
        }