public async Task NoCertificateAvailable_ReturnsErrorResponse() { TestMocks mocks = new TestMocks(); mocks.ServerBehaviour.Setup(b => b.GetSSLCertificate(It.IsAny <IConnection>())).ReturnsAsync((X509Certificate)null); StartTlsVerb verb = new StartTlsVerb(); await verb.Process(mocks.Connection.Object, new SmtpCommand("STARTTLS")).ConfigureAwait(false); mocks.VerifyWriteResponseAsync(StandardSmtpResponseCode.CommandNotImplemented); }
public void NoCertificateAvailable_ReturnsErrorResponse() { Mocks mocks = new Mocks(); mocks.ServerBehaviour.Setup(b => b.GetSSLCertificate(It.IsAny <IConnection>())).Returns <X509Certificate>(null); StartTlsVerb verb = new StartTlsVerb(); verb.Process(mocks.Connection.Object, new SmtpCommand("STARTTLS")); mocks.VerifyWriteResponse(StandardSmtpResponseCode.CommandNotImplemented); }