public void SmtpDown() { var postalOffice = new SmtpPostalOffice(SmtpHost, SmtpPort, fromAddress); var ex = Record.Exception(() => postalOffice.Send("Pippo", "*****@*****.**")); Assert.IsType <SmtpException>(ex); }
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); }