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); }
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); }
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); }