Example #1
0
        public void mail_should_escape_input_SMTP()
        {
            var receiver = "*****@*****.**";
            var subject = "A test mail";
            var message = "Just see: if it works!";
            var encoding = PayloadGenerator.Mail.MailEncoding.SMTP;

            var generator = new PayloadGenerator.Mail(receiver, subject, message, encoding);

            generator.ToString().ShouldBe("SMTP:[email protected]:A test mail:Just see\\: if it works!");
        }
Example #2
0
        public void mail_should_build_type_mailto()
        {
            var receiver = "*****@*****.**";
            var subject = "A test mail";
            var message = "Just see if it works!";
            var encoding = PayloadGenerator.Mail.MailEncoding.MAILTO;

            var generator = new PayloadGenerator.Mail(receiver, subject, message, encoding);

            generator.ToString().ShouldBe("mailto:[email protected]?subject=A%20test%20mail&body=Just%20see%20if%20it%20works%21");
        }
Example #3
0
        public void mail_should_escape_input_MATMSG()
        {
            var receiver = "*****@*****.**";
            var subject = "A test mail";
            var message = "Just see if \\:;, it works!";
            var encoding = PayloadGenerator.Mail.MailEncoding.MATMSG;

            var generator = new PayloadGenerator.Mail(receiver, subject, message, encoding);

            generator.ToString().ShouldBe("MATMSG:TO:[email protected];SUB:A test mail;BODY:Just see if \\\\\\:\\;\\, it works!;;");
        }
Example #4
0
        public void mail_should_add_unused_params()
        {
            var receiver = "*****@*****.**";

            var generator = new PayloadGenerator.Mail(receiver);

            generator.ToString().ShouldBe("mailto:[email protected]?subject=&body=");
        }