From 63d6db2f4bbc6074d6137a1f6faa350245414232 Mon Sep 17 00:00:00 2001 From: Tino Hager Date: Sun, 22 Sep 2024 22:32:44 +0200 Subject: [PATCH] Update SmtpServerTests.cs --- Src/SmtpServer.Tests/SmtpServerTests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/SmtpServer.Tests/SmtpServerTests.cs b/Src/SmtpServer.Tests/SmtpServerTests.cs index d493f0c..9c69b88 100644 --- a/Src/SmtpServer.Tests/SmtpServerTests.cs +++ b/Src/SmtpServer.Tests/SmtpServerTests.cs @@ -411,6 +411,9 @@ public async Task SessionTimeoutIsExceeded_NoCommands() .Certificate(CreateCertificate()) ); + var stopwatch = new Stopwatch(); + stopwatch.Start(); + using var tcpClient = new TcpClient(server, port); using var sslStream = new SslStream(tcpClient.GetStream(), false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null); @@ -420,9 +423,6 @@ public async Task SessionTimeoutIsExceeded_NoCommands() { var buffer = new byte[1024]; - var stopwatch = new Stopwatch(); - stopwatch.Start(); - var welcomeByteCount = await sslStream.ReadAsync(buffer, 0, buffer.Length); var emptyResponseCount = await sslStream.ReadAsync(buffer, 0, buffer.Length);