Exemple #1
0
        public void TestSequenceError()
        {
            AddTransactionProperty("MailInProgress", false);

            var handler = new RCPTHandler();

            handler.Initialize(Core);

            var response = handler.Execute(Transaction, "TO:<*****@*****.**>");

            Assert.Equal(SMTPStatusCode.BadSequence, response.Code);
        }
Exemple #2
0
        public void TestBadParamError()
        {
            AddTransactionProperty("MailInProgress", true);

            var handler = new RCPTHandler();

            handler.Initialize(Core);

            var response = handler.Execute(Transaction, "fubar");

            Assert.Equal(SMTPStatusCode.SyntaxError, response.Code);
        }
Exemple #3
0
        public void TestSuccessWithPostmaster()
        {
            var paths     = new List <MailPath>();
            var permanent = false;

            AddTransactionProperty("MailInProgress", true);
            AddTransactionListProperty("ForwardPath", () => paths, b => permanent = b);

            var handler = new RCPTHandler();

            handler.Initialize(Core);

            var response = handler.Execute(Transaction, "TO:<postmaster>");

            Assert.Equal(SMTPStatusCode.Okay, response.Code);
            Assert.Contains(MailPath.Postmaster, paths);
            Assert.False(permanent);
        }