示例#1
0
        public void SmtpDown()
        {
            var postalOffice = new SmtpPostalOffice(SmtpHost, SmtpPort, fromAddress);

            var ex = Record.Exception(() => postalOffice.Send("Pippo", "*****@*****.**"));

            Assert.IsType <SmtpException>(ex);
        }
示例#2
0
        public async Task OneMail()
        {
            var postalOffice = new SmtpPostalOffice(SmtpHost, SmtpPort, fromAddress);

            postalOffice.Send("Pippo", "*****@*****.**");

            var serverInfo = await _smtpServer.GetServerInfo();

            Assert.Equal(1, serverInfo.MailReceived);
            var msg = serverInfo.Messages[0];

            Assert.Equal(MailInfo(name: "Pippo", to: "*****@*****.**"), msg);
        }