From 709a63ae66eb3d446833a2e0aa6f7fb62f8c5c3d Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sat, 9 Dec 2023 14:32:17 -0500 Subject: [PATCH] Updated unit tests to use interpolated strings in Assert.Fail() --- UnitTests/AnnotationEntryTests.cs | 32 +- UnitTests/Net/Imap/ImapClientTests.cs | 352 +++++++------- UnitTests/Net/Imap/ImapEngineTests.cs | 18 +- .../Net/Imap/ImapFolderAnnotationsTests.cs | 76 ++-- UnitTests/Net/Imap/ImapFolderFetchTests.cs | 80 ++-- UnitTests/Net/Imap/ImapFolderFlagsTests.cs | 12 +- UnitTests/Net/Imap/ImapFolderSearchTests.cs | 92 ++-- UnitTests/Net/Imap/ImapFolderTests.cs | 148 +++--- UnitTests/Net/Imap/ImapUtilsTests.cs | 166 +++---- UnitTests/Net/Pop3/Pop3ClientTests.cs | 428 +++++++++--------- UnitTests/Net/Smtp/SmtpClientTests.cs | 358 +++++++-------- .../Security/SaslMechanismDigestMd5Tests.cs | 2 +- .../Security/SaslMechanismScramSha1Tests.cs | 2 +- .../Security/SaslMechanismScramSha256Tests.cs | 2 +- .../Security/SaslMechanismScramSha512Tests.cs | 2 +- UnitTests/Security/SaslMechanismTests.cs | 2 +- .../Security/SslHandshakeExceptionTests.cs | 8 +- 17 files changed, 890 insertions(+), 890 deletions(-) diff --git a/UnitTests/AnnotationEntryTests.cs b/UnitTests/AnnotationEntryTests.cs index 6b94e21bf4..e34d841f6b 100644 --- a/UnitTests/AnnotationEntryTests.cs +++ b/UnitTests/AnnotationEntryTests.cs @@ -165,7 +165,7 @@ public void TestParse () try { entry = AnnotationEntry.Parse ("/comment"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual ("/comment", entry.Entry, "Entry"); @@ -176,7 +176,7 @@ public void TestParse () try { entry = AnnotationEntry.Parse ("/comment.priv"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual ("/comment.priv", entry.Entry, "Entry"); @@ -187,7 +187,7 @@ public void TestParse () try { entry = AnnotationEntry.Parse ("/comment.shared"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } entry = new AnnotationEntry ("/comment", AnnotationScope.Shared); @@ -199,7 +199,7 @@ public void TestParse () try { entry = AnnotationEntry.Parse ("/1.2.3.4/comment"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual ("/1.2.3.4/comment", entry.Entry, "Entry"); @@ -210,7 +210,7 @@ public void TestParse () try { entry = AnnotationEntry.Parse ("/1.2.3.4/comment.priv"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual ("/1.2.3.4/comment.priv", entry.Entry, "Entry"); @@ -221,7 +221,7 @@ public void TestParse () try { entry = AnnotationEntry.Parse ("/1.2.3.4/comment.shared"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual ("/1.2.3.4/comment.shared", entry.Entry, "Entry"); @@ -238,7 +238,7 @@ public void TestCreate () try { entry = AnnotationEntry.Create ("/comment"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual (AnnotationEntry.Comment, entry, "/comment"); @@ -246,7 +246,7 @@ public void TestCreate () try { entry = AnnotationEntry.Create ("/comment.priv"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual (AnnotationEntry.PrivateComment, entry, "/comment.priv"); @@ -254,7 +254,7 @@ public void TestCreate () try { entry = AnnotationEntry.Create ("/comment.shared"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual (AnnotationEntry.SharedComment, entry, "/comment.shared"); @@ -262,7 +262,7 @@ public void TestCreate () try { entry = AnnotationEntry.Create ("/flags"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual (AnnotationEntry.Flags, entry, "/flags"); @@ -270,7 +270,7 @@ public void TestCreate () try { entry = AnnotationEntry.Create ("/flags.priv"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual (AnnotationEntry.PrivateFlags, entry, "/flags.priv"); @@ -278,7 +278,7 @@ public void TestCreate () try { entry = AnnotationEntry.Create ("/flags.shared"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual (AnnotationEntry.SharedFlags, entry, "/flags.shared"); @@ -286,7 +286,7 @@ public void TestCreate () try { entry = AnnotationEntry.Create ("/altsubject"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual (AnnotationEntry.AltSubject, entry, "/altsubject"); @@ -294,7 +294,7 @@ public void TestCreate () try { entry = AnnotationEntry.Create ("/altsubject.priv"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual (AnnotationEntry.PrivateAltSubject, entry, "/altsubject.priv"); @@ -302,7 +302,7 @@ public void TestCreate () try { entry = AnnotationEntry.Create ("/altsubject.shared"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual (AnnotationEntry.SharedAltSubject, entry, "/altsubject.shared"); @@ -310,7 +310,7 @@ public void TestCreate () try { entry = AnnotationEntry.Create ("/1.2.3.4/comment"); } catch (Exception ex) { - Assert.Fail ("Did not expect: {0}", ex); + Assert.Fail ($"Did not expect: {ex}"); return; } Assert.AreEqual ("/1.2.3.4/comment", entry.Entry, "Entry"); diff --git a/UnitTests/Net/Imap/ImapClientTests.cs b/UnitTests/Net/Imap/ImapClientTests.cs index 33beafad9d..acac3e4b3e 100644 --- a/UnitTests/Net/Imap/ImapClientTests.cs +++ b/UnitTests/Net/Imap/ImapClientTests.cs @@ -175,7 +175,7 @@ public void TestArgumentExceptions () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Authenticate @@ -204,7 +204,7 @@ public void TestArgumentExceptions () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } // Notify @@ -250,7 +250,7 @@ public void TestIMAP4rev2 () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.AreEqual (IMAP4rev2CoreCapabilities | ImapCapabilities.StartTLS | ImapCapabilities.LoginDisabled, client.Capabilities, "Capabilities"); @@ -267,7 +267,7 @@ public async Task TestIMAP4rev2Async () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.AreEqual (IMAP4rev2CoreCapabilities | ImapCapabilities.StartTLS | ImapCapabilities.LoginDisabled, client.Capabilities, "Capabilities"); @@ -389,7 +389,7 @@ public void TestSslHandshakeExceptions () if (ex.RootCertificateAuthority is X509Certificate2 root) SslHandshakeExceptionTests.AssertRootCertificate (root); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } try { @@ -404,7 +404,7 @@ public void TestSslHandshakeExceptions () if (ex.RootCertificateAuthority is X509Certificate2 root) SslHandshakeExceptionTests.AssertRootCertificate (root); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } } } @@ -433,7 +433,7 @@ public async Task TestSslHandshakeExceptionsAsync () if (ex.RootCertificateAuthority is X509Certificate2 root) SslHandshakeExceptionTests.AssertRootCertificate (root); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } try { @@ -448,7 +448,7 @@ public async Task TestSslHandshakeExceptionsAsync () if (ex.RootCertificateAuthority is X509Certificate2 root) SslHandshakeExceptionTests.AssertRootCertificate (root); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } } } @@ -1023,7 +1023,7 @@ public void TestGreetingCapabilities () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1045,7 +1045,7 @@ public async Task TestGreetingCapabilitiesAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1070,7 +1070,7 @@ public void TestByeGreeting () } catch (ImapProtocolException ex) { Assert.AreEqual ("The IMAP server unexpectedly refused the connection.", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect this exception in Connect: {ex}"); } client.Disconnect (false); @@ -1091,7 +1091,7 @@ public async Task TestByeGreetingAsync () } catch (ImapProtocolException ex) { Assert.AreEqual ("The IMAP server unexpectedly refused the connection.", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect this exception in Connect: {ex}"); } await client.DisconnectAsync (false); @@ -1119,7 +1119,7 @@ public void TestByeGreetingWithAlert () } catch (ImapProtocolException ex) { Assert.AreEqual ("Too many connections.", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect this exception in Connect: {ex}"); } Assert.AreEqual (1, alerts, "Expected 1 alert"); @@ -1149,7 +1149,7 @@ public async Task TestByeGreetingWithAlertAsync () } catch (ImapProtocolException ex) { Assert.AreEqual ("Too many connections.", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect this exception in Connect: {ex}"); } Assert.AreEqual (1, alerts, "Expected 1 alert"); @@ -1172,7 +1172,7 @@ public void TestByeGreetingWithRespText () } catch (ImapProtocolException ex) { Assert.AreEqual ("Too many connections.", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect this exception in Connect: {ex}"); } client.Disconnect (false); @@ -1193,7 +1193,7 @@ public async Task TestByeGreetingWithRespTextAsync () } catch (ImapProtocolException ex) { Assert.AreEqual ("Too many connections.", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect this exception in Connect: {ex}"); } await client.DisconnectAsync (false); @@ -1222,13 +1222,13 @@ public void TestUnexpectedBye () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect this exception in Connect: {ex}"); } try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -1237,7 +1237,7 @@ public void TestUnexpectedBye () } catch (ImapProtocolException ex) { Assert.AreEqual ("System going down for a reboot.", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Open: {0}", ex); + Assert.Fail ($"Did not expect this exception in Open: {ex}"); } client.Disconnect (false); @@ -1253,13 +1253,13 @@ public async Task TestUnexpectedByeAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect this exception in Connect: {ex}"); } try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -1268,7 +1268,7 @@ public async Task TestUnexpectedByeAsync () } catch (ImapProtocolException ex) { Assert.AreEqual ("System going down for a reboot.", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Open: {0}", ex); + Assert.Fail ($"Did not expect this exception in Open: {ex}"); } await client.DisconnectAsync (false); @@ -1295,7 +1295,7 @@ public void TestUnexpectedByeAfterCapability () } catch (ImapProtocolException ex) { Assert.AreEqual ("Autologout; idle for too long (1)", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect this exception in Connect: {ex}"); } client.Disconnect (false); @@ -1314,7 +1314,7 @@ public async Task TestUnexpectedByeAfterCapabilityAsync () } catch (ImapProtocolException ex) { Assert.AreEqual ("Autologout; idle for too long (1)", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect this exception in Connect: {ex}"); } await client.DisconnectAsync (false); @@ -1350,13 +1350,13 @@ public void TestUnexpectedByeWithAlert () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect this exception in Connect: {ex}"); } try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -1365,7 +1365,7 @@ public void TestUnexpectedByeWithAlert () } catch (ImapProtocolException ex) { Assert.AreEqual ("System going down for a reboot.", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Open: {0}", ex); + Assert.Fail ($"Did not expect this exception in Open: {ex}"); } Assert.AreEqual (1, alerts, "Expected 1 alert"); @@ -1390,13 +1390,13 @@ public async Task TestUnexpectedByeWithAlertAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect this exception in Connect: {ex}"); } try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -1405,7 +1405,7 @@ public async Task TestUnexpectedByeWithAlertAsync () } catch (ImapProtocolException ex) { Assert.AreEqual ("System going down for a reboot.", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Open: {0}", ex); + Assert.Fail ($"Did not expect this exception in Open: {ex}"); } Assert.AreEqual (1, alerts, "Expected 1 alert"); @@ -1432,7 +1432,7 @@ public void TestUnexpectedByeInSaslAuthenticate () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1443,7 +1443,7 @@ public void TestUnexpectedByeInSaslAuthenticate () } catch (ImapProtocolException pex) { Assert.AreEqual ("you are not allowed to act as a proxy server", pex.Message); } catch (Exception ex) { - Assert.Fail ("Expected ImapProtocolException, but got: {0}", ex); + Assert.Fail ($"Expected ImapProtocolException, but got: {ex}"); } } } @@ -1457,7 +1457,7 @@ public async Task TestUnexpectedByeInSaslAuthenticateAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1468,7 +1468,7 @@ public async Task TestUnexpectedByeInSaslAuthenticateAsync () } catch (ImapProtocolException pex) { Assert.AreEqual ("you are not allowed to act as a proxy server", pex.Message); } catch (Exception ex) { - Assert.Fail ("Expected ImapProtocolException, but got: {0}", ex); + Assert.Fail ($"Expected ImapProtocolException, but got: {ex}"); } } } @@ -1495,19 +1495,19 @@ public void TestInvalidTaggedByeDuringLogout () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect this exception in Connect: {ex}"); } try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Exceptions should be swallowed in Disconnect: {0}", ex); + Assert.Fail ($"Exceptions should be swallowed in Disconnect: {ex}"); } } } @@ -1521,19 +1521,19 @@ public async Task TestInvalidTaggedByeDuringLogoutAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect this exception in Connect: {ex}"); } try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Exceptions should be swallowed in Disconnect: {0}", ex); + Assert.Fail ($"Exceptions should be swallowed in Disconnect: {ex}"); } } } @@ -1563,7 +1563,7 @@ public void TestPreAuthGreeting () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1598,7 +1598,7 @@ public async Task TestPreAuthGreetingAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1642,7 +1642,7 @@ public void TestPreAuthCapabilityGreeting () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1677,7 +1677,7 @@ public async Task TestPreAuthCapabilityGreetingAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1732,7 +1732,7 @@ public void TestGMailWebAlert () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -1743,7 +1743,7 @@ public void TestGMailWebAlert () } catch (AuthenticationException ax) { Assert.AreEqual (alert, ax.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, alerts, "Expected 1 alert"); @@ -1779,7 +1779,7 @@ public async Task TestGMailWebAlertAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -1790,7 +1790,7 @@ public async Task TestGMailWebAlertAsync () } catch (AuthenticationException ax) { Assert.AreEqual (alert, ax.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, alerts, "Expected 1 alert"); @@ -1820,7 +1820,7 @@ public void TestUnicodeRespText () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -1831,7 +1831,7 @@ public void TestUnicodeRespText () } catch (AuthenticationException ax) { Assert.AreEqual (respText, ax.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } client.Disconnect (false); @@ -1847,7 +1847,7 @@ public async Task TestUnicodeRespTextAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -1858,7 +1858,7 @@ public async Task TestUnicodeRespTextAsync () } catch (AuthenticationException ax) { Assert.AreEqual (respText, ax.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } await client.DisconnectAsync (false); @@ -1887,13 +1887,13 @@ public void TestInvalidUntaggedResponse () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var folder = client.GetFolder ("Buggy Folder Listing"); @@ -1913,13 +1913,13 @@ public async Task TestInvalidUntaggedResponseAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var folder = await client.GetFolderAsync ("Buggy Folder Listing"); @@ -1952,7 +1952,7 @@ public void TestInvalidUntaggedBadResponse () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -1968,7 +1968,7 @@ public void TestInvalidUntaggedBadResponse () } catch (AuthenticationException ax) { Assert.AreEqual (alertText, ax.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (5, alerts, "Unexpected number of alerts: {0}", alerts); @@ -1986,7 +1986,7 @@ public async Task TestInvalidUntaggedBadResponseAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -2002,7 +2002,7 @@ public async Task TestInvalidUntaggedBadResponseAsync () } catch (AuthenticationException ax) { Assert.AreEqual (alertText, ax.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (5, alerts, "Unexpected number of alerts: {0}", alerts); @@ -2035,7 +2035,7 @@ public void TestUntaggedRespCode () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2043,7 +2043,7 @@ public void TestUntaggedRespCode () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var trash = client.GetFolder (SpecialFolder.Trash); @@ -2066,7 +2066,7 @@ public async Task TestUntaggedRespCodeAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2074,7 +2074,7 @@ public async Task TestUntaggedRespCodeAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var trash = client.GetFolder (SpecialFolder.Trash); @@ -2111,7 +2111,7 @@ public void TesSuperfluousUntaggedOkNoOrBad () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2119,7 +2119,7 @@ public void TesSuperfluousUntaggedOkNoOrBad () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var trash = client.GetFolder (SpecialFolder.Trash); @@ -2142,7 +2142,7 @@ public async Task TestSuperfluousUntaggedOkNoOrBadAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2150,7 +2150,7 @@ public async Task TestSuperfluousUntaggedOkNoOrBadAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var trash = client.GetFolder (SpecialFolder.Trash); @@ -2185,7 +2185,7 @@ public void TestLogin () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2213,7 +2213,7 @@ public void TestLogin () try { client.Authenticate (new NetworkCredential ("Indiana \"Han Solo\" Jones", "p@ss\\word")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, authenticated, "Authenticated event was not emitted the expected number of times"); @@ -2233,7 +2233,7 @@ public async Task TestLoginAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2261,7 +2261,7 @@ public async Task TestLoginAsync () try { await client.AuthenticateAsync (new NetworkCredential ("Indiana \"Han Solo\" Jones", "p@ss\\word")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, authenticated, "Authenticated event was not emitted the expected number of times"); @@ -2293,7 +2293,7 @@ public void TestLoginSpecialCharacter () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2321,7 +2321,7 @@ public void TestLoginSpecialCharacter () try { client.Authenticate ("username", "pass%word"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, authenticated, "Authenticated event was not emitted the expected number of times"); @@ -2341,7 +2341,7 @@ public async Task TestLoginSpecialCharacterAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2369,7 +2369,7 @@ public async Task TestLoginSpecialCharacterAsync () try { await client.AuthenticateAsync ("username", "pass%word"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, authenticated, "Authenticated event was not emitted the expected number of times"); @@ -2398,7 +2398,7 @@ public void TestLoginDisabled () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2418,7 +2418,7 @@ public void TestLoginDisabled () } catch (AuthenticationException ax) { Assert.AreEqual ("AUTHENTICATE failed", ax.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -2429,7 +2429,7 @@ public void TestLoginDisabled () } catch (AuthenticationException ax) { Assert.AreEqual ("The LOGIN command is disabled.", ax.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } client.Disconnect (false); @@ -2445,7 +2445,7 @@ public async Task TestLoginDisabledAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.AreEqual (GMailInitialCapabilities | ImapCapabilities.LoginDisabled, client.Capabilities); @@ -2462,7 +2462,7 @@ public async Task TestLoginDisabledAsync () } catch (AuthenticationException ax) { Assert.AreEqual ("AUTHENTICATE failed", ax.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -2473,7 +2473,7 @@ public async Task TestLoginDisabledAsync () } catch (AuthenticationException ax) { Assert.AreEqual ("The LOGIN command is disabled.", ax.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } await client.DisconnectAsync (false); @@ -2500,7 +2500,7 @@ public void TestExchangeUserIsAuthenticatedButNotConnected () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.AreEqual (ImapCapabilities.IMAP4 | ImapCapabilities.IMAP4rev1 | ImapCapabilities.SaslIR | ImapCapabilities.UidPlus | ImapCapabilities.Id | @@ -2519,7 +2519,7 @@ public void TestExchangeUserIsAuthenticatedButNotConnected () Assert.AreEqual (ImapCommandResponse.Bad, cx.Response); Assert.AreEqual ("User is authenticated but not connected.", cx.ResponseText); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } client.Disconnect (false); @@ -2535,7 +2535,7 @@ public async Task TestExchangeUserIsAuthenticatedButNotConnectedAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.AreEqual (ImapCapabilities.IMAP4 | ImapCapabilities.IMAP4rev1 | ImapCapabilities.SaslIR | ImapCapabilities.UidPlus | ImapCapabilities.Id | @@ -2554,7 +2554,7 @@ public async Task TestExchangeUserIsAuthenticatedButNotConnectedAsync () Assert.AreEqual (ImapCommandResponse.Bad, cx.Response); Assert.AreEqual ("User is authenticated but not connected.", cx.ResponseText); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } await client.DisconnectAsync (false); @@ -2587,7 +2587,7 @@ public void TestAdvancedFeatures () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2617,7 +2617,7 @@ public void TestAdvancedFeatures () try { client.Authenticate (new NetworkCredential ("username", "password")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, authenticated, "Authenticated event was not emitted the expected number of times"); @@ -2661,7 +2661,7 @@ public async Task TestAdvancedFeaturesAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2691,7 +2691,7 @@ public async Task TestAdvancedFeaturesAsync () try { await client.AuthenticateAsync (new NetworkCredential ("username", "password")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, authenticated, "Authenticated event was not emitted the expected number of times"); @@ -2753,7 +2753,7 @@ public void TestSendingStringsAsLiterals () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: Do not try XOAUTH2 or PLAIN @@ -2763,7 +2763,7 @@ public void TestSendingStringsAsLiterals () try { client.Authenticate (new NetworkCredential ("username", "password")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } client.EnableUTF8 (); @@ -2791,7 +2791,7 @@ public async Task TestSendingStringsAsLiteralsAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: Do not try XOAUTH2 or PLAIN @@ -2801,7 +2801,7 @@ public async Task TestSendingStringsAsLiteralsAsync () try { await client.AuthenticateAsync (new NetworkCredential ("username", "password")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } await client.EnableUTF8Async (); @@ -2843,7 +2843,7 @@ public void TestSaslAuthentication () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2872,7 +2872,7 @@ public void TestSaslAuthentication () client.Authenticate (sasl); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, authenticated, "Authenticated event was not emitted the expected number of times"); @@ -2892,7 +2892,7 @@ public async Task TestSaslAuthenticationAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2921,7 +2921,7 @@ public async Task TestSaslAuthenticationAsync () await client.AuthenticateAsync (sasl); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, authenticated, "Authenticated event was not emitted the expected number of times"); @@ -2953,7 +2953,7 @@ public void TestSaslIRAuthentication () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2981,7 +2981,7 @@ public void TestSaslIRAuthentication () client.Authenticate (sasl); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, authenticated, "Authenticated event was not emitted the expected number of times"); @@ -3001,7 +3001,7 @@ public async Task TestSaslIRAuthenticationAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3029,7 +3029,7 @@ public async Task TestSaslIRAuthenticationAsync () await client.AuthenticateAsync (sasl); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, authenticated, "Authenticated event was not emitted the expected number of times"); @@ -3110,7 +3110,7 @@ public void TestRedactLogin () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3138,7 +3138,7 @@ public void TestRedactLogin () try { client.Authenticate ("username", "pass%word"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, authenticated, "Authenticated event was not emitted the expected number of times"); @@ -3162,7 +3162,7 @@ public async Task TestRedactLoginAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3190,7 +3190,7 @@ public async Task TestRedactLoginAsync () try { await client.AuthenticateAsync ("username", "pass%word"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, authenticated, "Authenticated event was not emitted the expected number of times"); @@ -3226,7 +3226,7 @@ public void TestRedactAuthentication () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3245,7 +3245,7 @@ public void TestRedactAuthentication () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailAuthenticatedCapabilities, client.Capabilities); @@ -3267,7 +3267,7 @@ public async Task TestRedactAuthenticationAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3286,7 +3286,7 @@ public async Task TestRedactAuthenticationAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailAuthenticatedCapabilities, client.Capabilities); @@ -3322,7 +3322,7 @@ public void TestRedactSaslAuthentication () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3351,7 +3351,7 @@ public void TestRedactSaslAuthentication () client.Authenticate (sasl); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, authenticated, "Authenticated event was not emitted the expected number of times"); @@ -3375,7 +3375,7 @@ public async Task TestRedactSaslAuthenticationAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3404,7 +3404,7 @@ public async Task TestRedactSaslAuthenticationAsync () await client.AuthenticateAsync (sasl); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, authenticated, "Authenticated event was not emitted the expected number of times"); @@ -3440,7 +3440,7 @@ public void TestEnableUTF8 () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3457,7 +3457,7 @@ public void TestEnableUTF8 () try { client.Authenticate (new NetworkCredential ("username", "password")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailAuthenticatedCapabilities, client.Capabilities); @@ -3481,7 +3481,7 @@ public async Task TestEnableUTF8Async () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3498,7 +3498,7 @@ public async Task TestEnableUTF8Async () try { await client.AuthenticateAsync (new NetworkCredential ("username", "password")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailAuthenticatedCapabilities, client.Capabilities); @@ -3534,7 +3534,7 @@ public void TestEnableQuickResync () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.AreEqual (DovecotInitialCapabilities, client.Capabilities); @@ -3550,7 +3550,7 @@ public void TestEnableQuickResync () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (DovecotAuthenticatedCapabilities, client.Capabilities); @@ -3576,7 +3576,7 @@ public async Task TestEnableQuickResyncAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.AreEqual (DovecotInitialCapabilities, client.Capabilities); @@ -3592,7 +3592,7 @@ public async Task TestEnableQuickResyncAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (DovecotAuthenticatedCapabilities, client.Capabilities); @@ -3668,7 +3668,7 @@ public void TestGetFolders () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3687,7 +3687,7 @@ public void TestGetFolders () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailAuthenticatedCapabilities | ImapCapabilities.StatusSize | ImapCapabilities.ObjectID, client.Capabilities); @@ -3776,7 +3776,7 @@ public async Task TestGetFoldersAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3795,7 +3795,7 @@ public async Task TestGetFoldersAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailAuthenticatedCapabilities | ImapCapabilities.StatusSize | ImapCapabilities.ObjectID, client.Capabilities); @@ -3898,7 +3898,7 @@ public void TestGetQuotaNonexistantQuotaRoot () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3917,7 +3917,7 @@ public void TestGetQuotaNonexistantQuotaRoot () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailAuthenticatedCapabilities, client.Capabilities); @@ -3949,7 +3949,7 @@ public async Task TestGetQuotaNonexistantQuotaRootAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3968,7 +3968,7 @@ public async Task TestGetQuotaNonexistantQuotaRootAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailAuthenticatedCapabilities, client.Capabilities); @@ -4143,7 +4143,7 @@ public void TestDovecot () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -4161,7 +4161,7 @@ public void TestDovecot () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (DovecotAuthenticatedCapabilities, client.Capabilities); @@ -4219,7 +4219,7 @@ public void TestDovecot () try { client.EnableQuickResync (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception when enabling QRESYNC: {0}", ex); + Assert.Fail ($"Did not expect an exception when enabling QRESYNC: {ex}"); } Assert.IsTrue (client.Inbox.Supports (FolderFeature.QuickResync)); @@ -4793,7 +4793,7 @@ public async Task TestDovecotAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -4811,7 +4811,7 @@ public async Task TestDovecotAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (DovecotAuthenticatedCapabilities, client.Capabilities); @@ -4859,7 +4859,7 @@ public async Task TestDovecotAsync () try { await client.EnableQuickResyncAsync (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception when enabling QRESYNC: {0}", ex); + Assert.Fail ($"Did not expect an exception when enabling QRESYNC: {ex}"); } // take advantage of LIST-STATUS to get top-level personal folders... @@ -5521,7 +5521,7 @@ public void TestGMail () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -5540,7 +5540,7 @@ public void TestGMail () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailAuthenticatedCapabilities, client.Capabilities); @@ -5684,7 +5684,7 @@ public async Task TestGMailAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -5703,7 +5703,7 @@ public async Task TestGMailAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailAuthenticatedCapabilities, client.Capabilities); @@ -5863,7 +5863,7 @@ public void TestGetFolder () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -5871,7 +5871,7 @@ public void TestGetFolder () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var level3 = client.GetFolder ("Level1/Level2/Level3"); @@ -5910,7 +5910,7 @@ public async Task TestGetFolderAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -5918,7 +5918,7 @@ public async Task TestGetFolderAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var level3 = await client.GetFolderAsync ("Level1/Level2/Level3"); @@ -5974,7 +5974,7 @@ public void TestIdentify () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -5991,7 +5991,7 @@ public void TestIdentify () try { client.Authenticate (new NetworkCredential ("username", "password")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailAuthenticatedCapabilities, client.Capabilities); @@ -6053,7 +6053,7 @@ public async Task TestIdentifyAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -6070,7 +6070,7 @@ public async Task TestIdentifyAsync () try { await client.AuthenticateAsync (new NetworkCredential ("username", "password")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailAuthenticatedCapabilities, client.Capabilities); @@ -6146,7 +6146,7 @@ public void TestIdle () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -6154,7 +6154,7 @@ public void TestIdle () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } using (var done = new CancellationTokenSource ()) { @@ -6208,7 +6208,7 @@ public async Task TestIdleAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -6216,7 +6216,7 @@ public async Task TestIdleAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } using (var done = new CancellationTokenSource ()) { @@ -6284,7 +6284,7 @@ public void TestIdleNotSupported () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -6292,7 +6292,7 @@ public void TestIdleNotSupported () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var inbox = client.Inbox; @@ -6318,7 +6318,7 @@ public async Task TestIdleNotSupportedAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -6326,7 +6326,7 @@ public async Task TestIdleNotSupportedAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var inbox = client.Inbox; @@ -6373,7 +6373,7 @@ public void TestNotify () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -6552,7 +6552,7 @@ public async Task TestNotifyAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -6750,7 +6750,7 @@ public void TestCompress () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -6758,7 +6758,7 @@ public void TestCompress () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } client.Compress (); @@ -6796,7 +6796,7 @@ public async Task TestCompressAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -6804,7 +6804,7 @@ public async Task TestCompressAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } await client.CompressAsync (); @@ -6861,7 +6861,7 @@ public void TestAccessControlLists () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -6880,7 +6880,7 @@ public void TestAccessControlLists () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (AclAuthenticatedCapabilities, client.Capabilities); @@ -6960,7 +6960,7 @@ public async Task TestAccessControlListsAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -6979,7 +6979,7 @@ public async Task TestAccessControlListsAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (AclAuthenticatedCapabilities, client.Capabilities); @@ -7088,7 +7088,7 @@ public void TestMetadata () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -7106,7 +7106,7 @@ public void TestMetadata () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (MetadataAuthenticatedCapabilities, client.Capabilities); @@ -7216,7 +7216,7 @@ public async Task TestMetadataAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -7234,7 +7234,7 @@ public async Task TestMetadataAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (MetadataAuthenticatedCapabilities, client.Capabilities); @@ -7354,7 +7354,7 @@ public void TestNamespaceExtensions () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -7362,7 +7362,7 @@ public void TestNamespaceExtensions () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, client.PersonalNamespaces.Count, "PersonalNamespaces.Count"); @@ -7390,7 +7390,7 @@ public async Task TestNamespaceExtensionsAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -7398,7 +7398,7 @@ public async Task TestNamespaceExtensionsAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, client.PersonalNamespaces.Count, "PersonalNamespaces.Count"); @@ -7433,7 +7433,7 @@ public void TestLowercaseImapResponses () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -7441,7 +7441,7 @@ public void TestLowercaseImapResponses () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, client.PersonalNamespaces.Count, "PersonalNamespaces.Count"); diff --git a/UnitTests/Net/Imap/ImapEngineTests.cs b/UnitTests/Net/Imap/ImapEngineTests.cs index 0d18464f7d..7913c6ae60 100644 --- a/UnitTests/Net/Imap/ImapEngineTests.cs +++ b/UnitTests/Net/Imap/ImapEngineTests.cs @@ -175,7 +175,7 @@ public void TestParseResponseCodeBadCharset () try { respCode = engine.ParseResponseCodeAsync (true, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing RESP-CODE failed: {0}", ex); + Assert.Fail ($"Parsing RESP-CODE failed: {ex}"); return; } @@ -206,7 +206,7 @@ public void TestParseResponseCodeBadUrl () try { respCode = engine.ParseResponseCodeAsync (true, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing RESP-CODE failed: {0}", ex); + Assert.Fail ($"Parsing RESP-CODE failed: {ex}"); return; } @@ -235,7 +235,7 @@ public void TestParseResponseCodeMaxConvertMessages () try { respCode = engine.ParseResponseCodeAsync (true, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing RESP-CODE failed: {0}", ex); + Assert.Fail ($"Parsing RESP-CODE failed: {ex}"); return; } @@ -264,7 +264,7 @@ public void TestParseResponseCodeMaxConvertParts () try { respCode = engine.ParseResponseCodeAsync (true, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing RESP-CODE failed: {0}", ex); + Assert.Fail ($"Parsing RESP-CODE failed: {ex}"); return; } @@ -293,7 +293,7 @@ public void TestParseResponseCodeNoUpdate () try { respCode = engine.ParseResponseCodeAsync (false, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing RESP-CODE failed: {0}", ex); + Assert.Fail ($"Parsing RESP-CODE failed: {ex}"); return; } @@ -322,7 +322,7 @@ public void TestParseResponseCodeNewName () try { respCode = engine.ParseResponseCodeAsync (true, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing RESP-CODE failed: {0}", ex); + Assert.Fail ($"Parsing RESP-CODE failed: {ex}"); return; } @@ -352,7 +352,7 @@ public void TestParseResponseCodeUndefinedFilter () try { respCode = engine.ParseResponseCodeAsync (true, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing RESP-CODE failed: {0}", ex); + Assert.Fail ($"Parsing RESP-CODE failed: {ex}"); return; } @@ -374,7 +374,7 @@ void TestGreetingDetection (string server, string fileName, ImapQuirksMode expec try { engine.Connect (tokenizer, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing greeting failed: {0}", ex); + Assert.Fail ($"Parsing greeting failed: {ex}"); return; } @@ -392,7 +392,7 @@ async Task TestGreetingDetectionAsync (string server, string fileName, ImapQuirk try { await engine.ConnectAsync (tokenizer, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing greeting failed: {0}", ex); + Assert.Fail ($"Parsing greeting failed: {ex}"); return; } diff --git a/UnitTests/Net/Imap/ImapFolderAnnotationsTests.cs b/UnitTests/Net/Imap/ImapFolderAnnotationsTests.cs index ff14dc54a0..fcabb54365 100644 --- a/UnitTests/Net/Imap/ImapFolderAnnotationsTests.cs +++ b/UnitTests/Net/Imap/ImapFolderAnnotationsTests.cs @@ -63,7 +63,7 @@ public void TestArgumentExceptions () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -72,7 +72,7 @@ public void TestArgumentExceptions () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -141,7 +141,7 @@ public void TestNotSupportedExceptions () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -150,7 +150,7 @@ public void TestNotSupportedExceptions () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -216,7 +216,7 @@ public void TestChangingAnnotationsOnEmptyListOfMessages () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -225,7 +225,7 @@ public void TestChangingAnnotationsOnEmptyListOfMessages () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -336,7 +336,7 @@ public void TestAppendWithAnnotations (bool withInternalDates) try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -344,7 +344,7 @@ public void TestAppendWithAnnotations (bool withInternalDates) try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } for (int i = 0; i < messages.Count; i++) { @@ -378,7 +378,7 @@ public async Task TestAppendWithAnnotationsAsync (bool withInternalDates) try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -386,7 +386,7 @@ public async Task TestAppendWithAnnotationsAsync (bool withInternalDates) try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } for (int i = 0; i < messages.Count; i++) { @@ -513,7 +513,7 @@ public void TestMultiAppendWithAnnotations (bool withInternalDates) try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -521,7 +521,7 @@ public void TestMultiAppendWithAnnotations (bool withInternalDates) try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } // Use MULTIAPPEND to append some test messages @@ -562,7 +562,7 @@ public async Task TestMultiAppendWithAnnotationsAsync (bool withInternalDates) try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -570,7 +570,7 @@ public async Task TestMultiAppendWithAnnotationsAsync (bool withInternalDates) try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } // Use MULTIAPPEND to append some test messages @@ -662,7 +662,7 @@ public void TestReplaceWithAnnotations () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -670,7 +670,7 @@ public void TestReplaceWithAnnotations () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } client.Inbox.Open (FolderAccess.ReadWrite); @@ -697,7 +697,7 @@ public async Task TestReplaceWithAnnotationsAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -705,7 +705,7 @@ public async Task TestReplaceWithAnnotationsAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } await client.Inbox.OpenAsync (FolderAccess.ReadWrite); @@ -732,7 +732,7 @@ public void TestReplaceByUidWithAnnotations () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -740,7 +740,7 @@ public void TestReplaceByUidWithAnnotations () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } client.Inbox.Open (FolderAccess.ReadWrite); @@ -767,7 +767,7 @@ public async Task TestReplaceByUidWithAnnotationsAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.AuthenticationMechanisms.Clear (); @@ -775,7 +775,7 @@ public async Task TestReplaceByUidWithAnnotationsAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } await client.Inbox.OpenAsync (FolderAccess.ReadWrite); @@ -816,7 +816,7 @@ public void TestSelectAnnotateNone () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -825,7 +825,7 @@ public void TestSelectAnnotateNone () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -852,7 +852,7 @@ public async Task TestSelectAnnotateNoneAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -861,7 +861,7 @@ public async Task TestSelectAnnotateNoneAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -903,7 +903,7 @@ public void TestSearchAnnotations () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -912,7 +912,7 @@ public void TestSearchAnnotations () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -949,7 +949,7 @@ public async Task TestSearchAnnotationsAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -958,7 +958,7 @@ public async Task TestSearchAnnotationsAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -1009,7 +1009,7 @@ public void TestSortAnnotations () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1018,7 +1018,7 @@ public void TestSortAnnotations () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -1060,7 +1060,7 @@ public async Task TestSortAnnotationsAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1069,7 +1069,7 @@ public async Task TestSortAnnotationsAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -1131,7 +1131,7 @@ public void TestStore () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1140,7 +1140,7 @@ public void TestStore () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -1191,7 +1191,7 @@ public async Task TestStoreAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1200,7 +1200,7 @@ public async Task TestStoreAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); diff --git a/UnitTests/Net/Imap/ImapFolderFetchTests.cs b/UnitTests/Net/Imap/ImapFolderFetchTests.cs index cbd16c97bd..9875c07e31 100644 --- a/UnitTests/Net/Imap/ImapFolderFetchTests.cs +++ b/UnitTests/Net/Imap/ImapFolderFetchTests.cs @@ -101,7 +101,7 @@ public void TestArgumentExceptions () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -110,7 +110,7 @@ public void TestArgumentExceptions () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -418,7 +418,7 @@ public void TestNotSupportedExceptions () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -427,7 +427,7 @@ public void TestNotSupportedExceptions () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -505,7 +505,7 @@ public void TestFetchPreviewText () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: Do not try XOAUTH2 @@ -514,7 +514,7 @@ public void TestFetchPreviewText () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } // disable LIST-EXTENDED @@ -558,7 +558,7 @@ public async Task TestFetchPreviewTextAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: Do not try XOAUTH2 @@ -567,7 +567,7 @@ public async Task TestFetchPreviewTextAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } // disable LIST-EXTENDED @@ -773,7 +773,7 @@ public void TestFetchSimulatedPreviewText () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: Do not try XOAUTH2 @@ -782,7 +782,7 @@ public void TestFetchSimulatedPreviewText () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } // disable LIST-EXTENDED @@ -823,7 +823,7 @@ public async Task TestFetchSimulatedPreviewTextAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: Do not try XOAUTH2 @@ -832,7 +832,7 @@ public async Task TestFetchSimulatedPreviewTextAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } // disable LIST-EXTENDED @@ -888,7 +888,7 @@ public void TestExpungeDuringFetch () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: Do not try XOAUTH2 @@ -897,7 +897,7 @@ public void TestExpungeDuringFetch () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } // disable LIST-EXTENDED @@ -937,7 +937,7 @@ public async Task TestExpungeDuringFetchAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: Do not try XOAUTH2 @@ -946,7 +946,7 @@ public async Task TestExpungeDuringFetchAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } // disable LIST-EXTENDED @@ -1001,7 +1001,7 @@ public void TestExtractingPrecisePangolinAttachment () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: Do not try XOAUTH2 @@ -1010,7 +1010,7 @@ public void TestExtractingPrecisePangolinAttachment () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var inbox = client.Inbox; @@ -1069,7 +1069,7 @@ public async Task TestExtractingPrecisePangolinAttachmentAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: Do not try XOAUTH2 @@ -1078,7 +1078,7 @@ public async Task TestExtractingPrecisePangolinAttachmentAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var inbox = client.Inbox; @@ -1152,13 +1152,13 @@ public void TestFetchObjectIdAttributes () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.ObjectID), "OBJECTID"); @@ -1194,13 +1194,13 @@ public async Task TestFetchObjectIdAttributesAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.ObjectID), "OBJECTID"); @@ -1251,13 +1251,13 @@ public void TestFetchSaveDate () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.SaveDate), "SAVEDATE"); @@ -1291,13 +1291,13 @@ public async Task TestFetchSaveDateAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.SaveDate), "SAVEDATE"); @@ -1345,7 +1345,7 @@ public void TestFetchAnnotations () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1354,7 +1354,7 @@ public void TestFetchAnnotations () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.Annotate), "ANNOTATE-EXPERIMENT-1"); @@ -1424,7 +1424,7 @@ public async Task TestFetchAnnotationsAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1433,7 +1433,7 @@ public async Task TestFetchAnnotationsAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.Annotate), "ANNOTATE-EXPERIMENT-1"); @@ -1517,7 +1517,7 @@ public void TestDominoParenthesisWorkaround () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1526,7 +1526,7 @@ public void TestDominoParenthesisWorkaround () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, client.PersonalNamespaces.Count, "Personal Count"); @@ -1564,7 +1564,7 @@ public async Task TestDominoParenthesisWorkaroundAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1573,7 +1573,7 @@ public async Task TestDominoParenthesisWorkaroundAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (1, client.PersonalNamespaces.Count, "Personal Count"); @@ -1627,13 +1627,13 @@ public void TestFetchStreamUnsolicitedInfo () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.Annotate), "ANNOTATE-EXPERIMENT-1"); @@ -1693,13 +1693,13 @@ public async Task TestFetchStreamUnsolicitedInfoAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.Annotate), "ANNOTATE-EXPERIMENT-1"); diff --git a/UnitTests/Net/Imap/ImapFolderFlagsTests.cs b/UnitTests/Net/Imap/ImapFolderFlagsTests.cs index b5cc6ab686..6640eb8ca7 100644 --- a/UnitTests/Net/Imap/ImapFolderFlagsTests.cs +++ b/UnitTests/Net/Imap/ImapFolderFlagsTests.cs @@ -53,7 +53,7 @@ public void TestArgumentExceptions () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -62,7 +62,7 @@ public void TestArgumentExceptions () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -350,7 +350,7 @@ public void TestNotSupportedExceptions () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -359,7 +359,7 @@ public void TestNotSupportedExceptions () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -448,7 +448,7 @@ public void TestChangingFlagsOnEmptyListOfMessages () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -457,7 +457,7 @@ public void TestChangingFlagsOnEmptyListOfMessages () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); diff --git a/UnitTests/Net/Imap/ImapFolderSearchTests.cs b/UnitTests/Net/Imap/ImapFolderSearchTests.cs index ab40b2142c..8dffcab1e8 100644 --- a/UnitTests/Net/Imap/ImapFolderSearchTests.cs +++ b/UnitTests/Net/Imap/ImapFolderSearchTests.cs @@ -54,7 +54,7 @@ public void TestArgumentExceptions () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -63,7 +63,7 @@ public void TestArgumentExceptions () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -173,7 +173,7 @@ public void TestSearchFilter () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -182,7 +182,7 @@ public void TestSearchFilter () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.Filters), "ImapCapabilities.Filters"); @@ -216,7 +216,7 @@ public async Task TestSearchFilterAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -225,7 +225,7 @@ public async Task TestSearchFilterAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.Filters), "ImapCapabilities.Filters"); @@ -272,7 +272,7 @@ public void TestSearchFuzzy () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -281,7 +281,7 @@ public void TestSearchFuzzy () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.FuzzySearch), "ImapCapabilities.FuzzySearch"); @@ -313,7 +313,7 @@ public async Task TestSearchFuzzyAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -322,7 +322,7 @@ public async Task TestSearchFuzzyAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.FuzzySearch), "ImapCapabilities.FuzzySearch"); @@ -370,7 +370,7 @@ public void TestSearchSaveDate () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -379,7 +379,7 @@ public void TestSearchSaveDate () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.SaveDate), "ImapCapabilities.SaveDate"); @@ -429,7 +429,7 @@ public async Task TestSearchSaveDateAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -438,7 +438,7 @@ public async Task TestSearchSaveDateAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.SaveDate), "ImapCapabilities.SaveDate"); @@ -501,7 +501,7 @@ public void TestRawUnicodeSearch () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -510,7 +510,7 @@ public void TestRawUnicodeSearch () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -543,7 +543,7 @@ public async Task TestRawUnicodeSearchAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -552,7 +552,7 @@ public async Task TestRawUnicodeSearchAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -598,7 +598,7 @@ public void TestSearchStringWithSpaces () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -607,7 +607,7 @@ public void TestSearchStringWithSpaces () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -635,7 +635,7 @@ public async Task TestSearchStringWithSpacesAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -644,7 +644,7 @@ public async Task TestSearchStringWithSpacesAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -688,7 +688,7 @@ public void TestSearchBadCharsetFallback () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -697,7 +697,7 @@ public void TestSearchBadCharsetFallback () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -725,7 +725,7 @@ public async Task TestSearchBadCharsetFallbackAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -734,7 +734,7 @@ public async Task TestSearchBadCharsetFallbackAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -778,7 +778,7 @@ public void TestSearchWithOptionsBadCharsetFallback () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -787,7 +787,7 @@ public void TestSearchWithOptionsBadCharsetFallback () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -821,7 +821,7 @@ public async Task TestSearchWithOptionsBadCharsetFallbackAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -830,7 +830,7 @@ public async Task TestSearchWithOptionsBadCharsetFallbackAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -880,7 +880,7 @@ public void TestSortBadCharsetFallback () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -889,7 +889,7 @@ public void TestSortBadCharsetFallback () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -917,7 +917,7 @@ public async Task TestSortBadCharsetFallbackAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -926,7 +926,7 @@ public async Task TestSortBadCharsetFallbackAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -970,7 +970,7 @@ public void TestSortWithOptionsBadCharsetFallback () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -979,7 +979,7 @@ public void TestSortWithOptionsBadCharsetFallback () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -1013,7 +1013,7 @@ public async Task TestSortWithOptionsBadCharsetFallbackAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1022,7 +1022,7 @@ public async Task TestSortWithOptionsBadCharsetFallbackAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -1074,7 +1074,7 @@ public void TestThreadBadCharsetFallback () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1083,7 +1083,7 @@ public void TestThreadBadCharsetFallback () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -1112,7 +1112,7 @@ public async Task TestThreadBadCharsetFallbackAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1121,7 +1121,7 @@ public async Task TestThreadBadCharsetFallbackAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -1166,7 +1166,7 @@ public void TestThreadUidsBadCharsetFallback () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1175,7 +1175,7 @@ public void TestThreadUidsBadCharsetFallback () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); @@ -1204,7 +1204,7 @@ public async Task TestThreadUidsBadCharsetFallbackAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1213,7 +1213,7 @@ public async Task TestThreadUidsBadCharsetFallbackAsync () try { await client.AuthenticateAsync (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsInstanceOf (client.Inbox.SyncRoot, "SyncRoot"); diff --git a/UnitTests/Net/Imap/ImapFolderTests.cs b/UnitTests/Net/Imap/ImapFolderTests.cs index 8080ce1cf7..d868234c08 100644 --- a/UnitTests/Net/Imap/ImapFolderTests.cs +++ b/UnitTests/Net/Imap/ImapFolderTests.cs @@ -82,7 +82,7 @@ public void TestArgumentExceptions () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -91,7 +91,7 @@ public void TestArgumentExceptions () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var personal = client.GetFolder (client.PersonalNamespaces[0]); @@ -374,7 +374,7 @@ public void TestNotSupportedExceptions () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -383,7 +383,7 @@ public void TestNotSupportedExceptions () try { client.Authenticate (credentials); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } // disable all features @@ -516,13 +516,13 @@ public void TestAppendLimit () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.AppendLimit), "ImapCapabilities.AppendLimit"); @@ -556,13 +556,13 @@ public async Task TestAppendLimitAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.AppendLimit), "ImapCapabilities.AppendLimit"); @@ -673,13 +673,13 @@ public void TestAppend (bool withKeywords, bool withInternalDates) try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } for (int i = 0; i < messages.Count; i++) { @@ -723,13 +723,13 @@ public async Task TestAppendAsync (bool withKeywords, bool withInternalDates) try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } for (int i = 0; i < messages.Count; i++) { @@ -883,7 +883,7 @@ public void TestMultiAppend (bool withKeywords, bool withInternalDates) try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -892,7 +892,7 @@ public void TestMultiAppend (bool withKeywords, bool withInternalDates) try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.MultiAppend), "MULTIAPPEND"); @@ -967,7 +967,7 @@ public async Task TestMultiAppendAsync (bool withKeywords, bool withInternalDate try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -976,7 +976,7 @@ public async Task TestMultiAppendAsync (bool withKeywords, bool withInternalDate try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.MultiAppend), "MULTIAPPEND"); @@ -1139,7 +1139,7 @@ public void TestReplace (bool clientSide, bool withKeywords, bool withInternalDa try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1148,7 +1148,7 @@ public void TestReplace (bool clientSide, bool withKeywords, bool withInternalDa try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } if (clientSide) @@ -1204,7 +1204,7 @@ public async Task TestReplaceAsync (bool clientSide, bool withKeywords, bool wit try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1213,7 +1213,7 @@ public async Task TestReplaceAsync (bool clientSide, bool withKeywords, bool wit try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } if (clientSide) @@ -1357,7 +1357,7 @@ public void TestReplaceByUid (bool clientSide, bool withKeywords, bool withInter try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1366,7 +1366,7 @@ public void TestReplaceByUid (bool clientSide, bool withKeywords, bool withInter try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } if (clientSide) @@ -1422,7 +1422,7 @@ public async Task TestReplaceByUidAsync (bool clientSide, bool withKeywords, boo try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } // Note: we do not want to use SASL at all... @@ -1431,7 +1431,7 @@ public async Task TestReplaceByUidAsync (bool clientSide, bool withKeywords, boo try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } if (clientSide) @@ -1508,7 +1508,7 @@ public void TestCreateRenameDelete () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1516,7 +1516,7 @@ public void TestCreateRenameDelete () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } int top1Renamed = 0, top2Renamed = 0, sub1Renamed = 0, sub2Renamed = 0; @@ -1583,7 +1583,7 @@ public async Task TestCreateRenameDeleteAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1591,7 +1591,7 @@ public async Task TestCreateRenameDeleteAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } int top1Renamed = 0, top2Renamed = 0, sub1Renamed = 0, sub2Renamed = 0; @@ -1673,7 +1673,7 @@ public void TestCreateMailboxId () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1681,7 +1681,7 @@ public void TestCreateMailboxId () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.ObjectID), "OBJECTID"); @@ -1704,7 +1704,7 @@ public async Task TestCreateMailboxIdAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1712,7 +1712,7 @@ public async Task TestCreateMailboxIdAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.ObjectID), "OBJECTID"); @@ -1750,7 +1750,7 @@ public void TestCreateSpecialUse () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1758,7 +1758,7 @@ public void TestCreateSpecialUse () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.CreateSpecialUse), "CREATE-SPECIAL-USE"); @@ -1784,7 +1784,7 @@ public async Task TestCreateSpecialUseAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1792,7 +1792,7 @@ public async Task TestCreateSpecialUseAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.CreateSpecialUse), "CREATE-SPECIAL-USE"); @@ -1834,7 +1834,7 @@ public void TestCreateSpecialUseMultiple () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1842,7 +1842,7 @@ public void TestCreateSpecialUseMultiple () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.CreateSpecialUse), "CREATE-SPECIAL-USE"); @@ -1880,7 +1880,7 @@ public void TestCreateSpecialUseMultiple () Assert.AreEqual (ImapCommandResponse.No, ex.Response); Assert.AreEqual ("An \\Important mailbox already exists", ex.ResponseText); } catch (Exception ex) { - Assert.Fail ("Unexpected exception: {0}", ex); + Assert.Fail ($"Unexpected exception: {ex}"); } client.Disconnect (true); @@ -1896,7 +1896,7 @@ public async Task TestCreateSpecialUseMultipleAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1904,7 +1904,7 @@ public async Task TestCreateSpecialUseMultipleAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.CreateSpecialUse), "CREATE-SPECIAL-USE"); @@ -1942,7 +1942,7 @@ public async Task TestCreateSpecialUseMultipleAsync () Assert.AreEqual (ImapCommandResponse.No, ex.Response); Assert.AreEqual ("An \\Important mailbox already exists", ex.ResponseText); } catch (Exception ex) { - Assert.Fail ("Unexpected exception: {0}", ex); + Assert.Fail ($"Unexpected exception: {ex}"); } await client.DisconnectAsync (true); @@ -1977,7 +1977,7 @@ public void TestCopyTo () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1985,7 +1985,7 @@ public void TestCopyTo () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.UidPlus), "Expected UIDPLUS extension"); @@ -2022,7 +2022,7 @@ public async Task TestCopyToAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2030,7 +2030,7 @@ public async Task TestCopyToAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.UidPlus), "Expected UIDPLUS extension"); @@ -2083,7 +2083,7 @@ public void TestExchangeCopyUidRespCodeWithoutOk () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2091,7 +2091,7 @@ public void TestExchangeCopyUidRespCodeWithoutOk () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.UidPlus), "Expected UIDPLUS extension"); @@ -2123,7 +2123,7 @@ public async Task TestExchangeCopyUidRespCodeWithoutOkAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2131,7 +2131,7 @@ public async Task TestExchangeCopyUidRespCodeWithoutOkAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.UidPlus), "Expected UIDPLUS extension"); @@ -2183,7 +2183,7 @@ public void TestMoveTo () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2191,7 +2191,7 @@ public void TestMoveTo () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.UidPlus), "Expected UIDPLUS extension"); @@ -2222,7 +2222,7 @@ public async Task TestMoveToAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2230,7 +2230,7 @@ public async Task TestMoveToAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.UidPlus), "Expected UIDPLUS extension"); @@ -2290,7 +2290,7 @@ public void TestUidMoveTo (bool disableMove) try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2298,7 +2298,7 @@ public void TestUidMoveTo (bool disableMove) try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.UidPlus), "Expected UIDPLUS extension"); @@ -2349,7 +2349,7 @@ public async Task TestUidMoveToAsync (bool disableMove) try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2357,7 +2357,7 @@ public async Task TestUidMoveToAsync (bool disableMove) try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (ImapCapabilities.UidPlus), "Expected UIDPLUS extension"); @@ -2435,7 +2435,7 @@ public void TestUidExpunge (bool disableUidPlus) try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2443,7 +2443,7 @@ public void TestUidExpunge (bool disableUidPlus) try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } int changed = 0, expunged = 0; @@ -2481,7 +2481,7 @@ public async Task TestUidExpungeAsync (bool disableUidPlus) try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2489,7 +2489,7 @@ public async Task TestUidExpungeAsync (bool disableUidPlus) try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } int changed = 0, expunged = 0; @@ -2543,7 +2543,7 @@ public void TestExplicitCountChanged () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2551,7 +2551,7 @@ public void TestExplicitCountChanged () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } client.Inbox.Open (FolderAccess.ReadOnly); @@ -2596,7 +2596,7 @@ public async Task TestExplicitCountChangedAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2604,7 +2604,7 @@ public async Task TestExplicitCountChangedAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } await client.Inbox.OpenAsync (FolderAccess.ReadOnly); @@ -2666,7 +2666,7 @@ public void TestImplicitCountChanged () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2674,7 +2674,7 @@ public void TestImplicitCountChanged () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } client.Inbox.Open (FolderAccess.ReadOnly); @@ -2719,7 +2719,7 @@ public async Task TestImplicitCountChangedAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2727,7 +2727,7 @@ public async Task TestImplicitCountChangedAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } await client.Inbox.OpenAsync (FolderAccess.ReadOnly); @@ -2811,7 +2811,7 @@ public void TestGetSubfoldersWithStatusItems () try { client.Connect (new ImapReplayStream (commands, false), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2819,7 +2819,7 @@ public void TestGetSubfoldersWithStatusItems () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var personal = client.GetFolder (client.PersonalNamespaces[0]); @@ -2878,13 +2878,13 @@ public async Task TestGetSuboldersWithStatusItemsAsync () try { await client.ConnectAsync (new ImapReplayStream (commands, true), "localhost", 143, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } var personal = client.GetFolder (client.PersonalNamespaces[0]); diff --git a/UnitTests/Net/Imap/ImapUtilsTests.cs b/UnitTests/Net/Imap/ImapUtilsTests.cs index abd34e7833..0e88c77dbf 100644 --- a/UnitTests/Net/Imap/ImapUtilsTests.cs +++ b/UnitTests/Net/Imap/ImapUtilsTests.cs @@ -195,7 +195,7 @@ public void TestParseLabelsListWithNIL () try { labels = ImapUtils.ParseLabelsListAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing X-GM-LABELS failed: {0}", ex); + Assert.Fail ($"Parsing X-GM-LABELS failed: {ex}"); return; } @@ -221,7 +221,7 @@ public async Task TestParseLabelsListWithNILAsync () try { labels = await ImapUtils.ParseLabelsListAsync (engine, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing X-GM-LABELS failed: {0}", ex); + Assert.Fail ($"Parsing X-GM-LABELS failed: {ex}"); return; } @@ -248,7 +248,7 @@ public void TestParseExampleBodyRfc3501 () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODY failed: {0}", ex); + Assert.Fail ($"Parsing BODY failed: {ex}"); return; } @@ -286,7 +286,7 @@ public async Task TestParseExampleBodyRfc3501Async () try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODY failed: {0}", ex); + Assert.Fail ($"Parsing BODY failed: {ex}"); return; } @@ -323,7 +323,7 @@ public void TestParseExampleEnvelopeRfc3501 () try { envelope = ImapUtils.ParseEnvelopeAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -374,7 +374,7 @@ public async Task TestParseExampleEnvelopeRfc3501Async () try { envelope = await ImapUtils.ParseEnvelopeAsync (engine, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -425,7 +425,7 @@ public void TestParseExampleEnvelopeRfc3501WithLiterals () try { envelope = ImapUtils.ParseEnvelopeAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -476,7 +476,7 @@ public async Task TestParseExampleEnvelopeRfc3501WithLiteralsAsync () try { envelope = await ImapUtils.ParseEnvelopeAsync (engine, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -529,7 +529,7 @@ public void TestParseEnvelopeWithMiscalculatedLiteralMailboxName () try { envelope = ImapUtils.ParseEnvelopeAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -577,7 +577,7 @@ public async Task TestParseEnvelopeWithMiscalculatedLiteralMailboxNameAsync () try { envelope = await ImapUtils.ParseEnvelopeAsync (engine, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -624,7 +624,7 @@ public void TestParseEnvelopeWithMissingMessageId () try { envelope = ImapUtils.ParseEnvelopeAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -672,7 +672,7 @@ public async Task TestParseEnvelopeWithMissingMessageIdAsync () try { envelope = await ImapUtils.ParseEnvelopeAsync (engine, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -720,7 +720,7 @@ public void TestParseEnvelopeWithMissingInReplyTo () try { envelope = ImapUtils.ParseEnvelopeAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -767,7 +767,7 @@ public async Task TestParseEnvelopeWithMissingInReplyToAsync () try { envelope = await ImapUtils.ParseEnvelopeAsync (engine, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -813,7 +813,7 @@ public void TestParseMalformedMailboxAddressInEnvelope () try { envelope = ImapUtils.ParseEnvelopeAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -859,7 +859,7 @@ public async Task TestParseMalformedMailboxAddressInEnvelopeAsync () try { envelope = await ImapUtils.ParseEnvelopeAsync (engine, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -908,7 +908,7 @@ public void TestParseGMailMalformedSenderInEnvelope () try { envelope = ImapUtils.ParseEnvelopeAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -955,7 +955,7 @@ public async Task TestParseGMailMalformedSenderInEnvelopeAsync () try { envelope = await ImapUtils.ParseEnvelopeAsync (engine, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -1000,7 +1000,7 @@ public void TestParseEnvelopeWithNilMailbox () try { envelope = ImapUtils.ParseEnvelopeAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -1027,7 +1027,7 @@ public void TestParseEnvelopeWithRoutedMailboxes () try { envelope = ImapUtils.ParseEnvelopeAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -1055,7 +1055,7 @@ public async Task TestParseEnvelopeWithRoutedMailboxesAsync () try { envelope = await ImapUtils.ParseEnvelopeAsync (engine, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -1084,7 +1084,7 @@ public void TestParseEnvelopeWithNilAddress () try { envelope = ImapUtils.ParseEnvelopeAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -1114,7 +1114,7 @@ public async Task TestParseEnvelopeWithNilAddressAsync () try { envelope = await ImapUtils.ParseEnvelopeAsync (engine, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -1143,7 +1143,7 @@ public void TestParseDovcotEnvelopeWithGroupAddresses () try { envelope = ImapUtils.ParseEnvelopeAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -1171,7 +1171,7 @@ public async Task TestParseDovcotEnvelopeWithGroupAddressesAsync () try { envelope = await ImapUtils.ParseEnvelopeAsync (engine, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing ENVELOPE failed: {0}", ex); + Assert.Fail ($"Parsing ENVELOPE failed: {ex}"); return; } @@ -1200,7 +1200,7 @@ public void TestParseExampleMultiLevelDovecotBodyStructure () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -1239,7 +1239,7 @@ public async Task TestParseExampleMultiLevelDovecotBodyStructureAsync () try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -1277,7 +1277,7 @@ public void TestParseBodyStructureWithBrokenMultipartRelated () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -1320,7 +1320,7 @@ public async Task TestParseBodyStructureWithBrokenMultipartRelatedAsync () try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -1363,7 +1363,7 @@ public void TestParseBodyStructureWithEmptyParenListAsMessageRfc822BodyToken () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -1432,7 +1432,7 @@ public async Task TestParseBodyStructureWithEmptyParenListAsMessageRfc822BodyTok try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -1500,7 +1500,7 @@ public void TestParseBodyStructureWithContentMd5DspLanguageAndLocation () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -1567,7 +1567,7 @@ public async Task TestParseBodyStructureWithContentMd5DspLanguageAndLocationAsyn try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -1634,7 +1634,7 @@ public void TestParseBodyStructureWithLiterals_LiteralsEverywhere () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -1701,7 +1701,7 @@ public async Task TestParseBodyStructureWithLiterals_LiteralsEverywhereAsync () try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -1768,7 +1768,7 @@ public void TestParseBodyStructureWithBodyExtensions () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -1835,7 +1835,7 @@ public async Task TestParseBodyStructureWithBodyExtensionsAsync () try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -1907,7 +1907,7 @@ public void TestParseGMailBadlyFormedMultipartBodyStructure () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -1956,7 +1956,7 @@ public async Task TestParseGMailBadlyFormedMultipartBodyStructureAsync () try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2003,7 +2003,7 @@ public void TestParseGMailBadlyFormedMultipartBodyStructure2 () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2082,7 +2082,7 @@ public async Task TestParseGMailBadlyFormedMultipartBodyStructure2Async () try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2163,7 +2163,7 @@ public void TestParseBadlyFormedBodyStructureWithEmptyStringMediaType () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2213,7 +2213,7 @@ public async Task TestParseBadlyFormedBodyStructureWithEmptyStringMediaTypeAsync try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2261,7 +2261,7 @@ public void TestParseBadlyFormedBodyStructureWithMissingMediaSubtypeApplication try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2301,7 +2301,7 @@ public async Task TestParseBadlyFormedBodyStructureWithMissingMediaSubtypeApplic try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2341,7 +2341,7 @@ public void TestParseBadlyFormedBodyStructureWithMissingMediaSubtypeAudio () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2381,7 +2381,7 @@ public async Task TestParseBadlyFormedBodyStructureWithMissingMediaSubtypeAudioA try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2421,7 +2421,7 @@ public void TestParseBadlyFormedBodyStructureWithMissingMediaSubtypeMessage () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2461,7 +2461,7 @@ public async Task TestParseBadlyFormedBodyStructureWithMissingMediaSubtypeMessag try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2501,7 +2501,7 @@ public void TestParseBadlyFormedBodyStructureWithMissingMediaSubtypeText () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2543,7 +2543,7 @@ public async Task TestParseBadlyFormedBodyStructureWithMissingMediaSubtypeTextAs try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2586,7 +2586,7 @@ public void TestParseBadlyQuotedBodyStructure () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2630,7 +2630,7 @@ public async Task TestParseBadlyQuotedBodyStructureAsync () try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2672,7 +2672,7 @@ public void TestParseMultipartBodyStructureWithNilBodyFldParam () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2715,7 +2715,7 @@ public async Task TestParseMultipartBodyStructureWithNilBodyFldParamAsync () try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2760,7 +2760,7 @@ public void TestParseMultipartBodyStructureWithoutBodyFldDsp () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2812,7 +2812,7 @@ public async Task TestParseMultipartBodyStructureWithoutBodyFldDspAsync () try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2864,7 +2864,7 @@ public void TestParseBodyStructureWithNonParenthesizedBodyFldDsp () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2918,7 +2918,7 @@ public async Task TestParseBodyStructureWithNonParenthesizedBodyFldDspAsync () try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -2973,7 +2973,7 @@ public void TestParseBodyStructureWithNilNilBodyFldDsp () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -3035,7 +3035,7 @@ public async Task TestParseBodyStructureWithNilNilBodyFldDspAsync () try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -3094,7 +3094,7 @@ public void TestParseBodyStructureWithSwappedBodyFldDspAndBodyFldLang () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -3130,7 +3130,7 @@ public async Task TestParseBodyStructureWithSwappedBodyFldDspAndBodyFldLangAsync try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -3167,7 +3167,7 @@ public void TestParseBodyStructureWithNegativeOctetValue () try { body = ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -3204,7 +3204,7 @@ public async Task TestParseBodyStructureWithNegativeOctetValueAsync () try { body = await ImapUtils.ParseBodyAsync (engine, "Unexpected token: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -3239,7 +3239,7 @@ public void TestParseBodyStructureWithNilMultipartBody () try { body = ImapUtils.ParseBodyAsync (engine, "Syntax error in BODYSTRUCTURE: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -3298,7 +3298,7 @@ public async Task TestParseBodyStructureWithNilMultipartBodyAsync () try { body = await ImapUtils.ParseBodyAsync (engine, "Syntax error in BODYSTRUCTURE: {0}", string.Empty, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -3357,7 +3357,7 @@ public void TestParseBadlyFormedBodyStructureWithCompletelyNilBodyParts1 () try { body = ImapUtils.ParseBodyAsync (engine, "Syntax error in BODYSTRUCTURE: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -3475,7 +3475,7 @@ public void TestParseBadlyFormedBodyStructureWithCompletelyNilBodyParts2 () try { body = ImapUtils.ParseBodyAsync (engine, "Syntax error in BODYSTRUCTURE: {0}", string.Empty, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing BODYSTRUCTURE failed: {0}", ex); + Assert.Fail ($"Parsing BODYSTRUCTURE failed: {ex}"); return; } @@ -3520,7 +3520,7 @@ public void TestParseExampleThreads () try { ImapUtils.ParseThreads (engine, 0, threads, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing THREAD response failed: {0}", ex); + Assert.Fail ($"Parsing THREAD response failed: {ex}"); return; } @@ -3575,7 +3575,7 @@ public async Task TestParseExampleThreadsAsync () try { await ImapUtils.ParseThreadsAsync (engine, 0, threads, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing THREAD response failed: {0}", ex); + Assert.Fail ($"Parsing THREAD response failed: {ex}"); return; } @@ -3630,7 +3630,7 @@ public void TestParseLongDovecotExampleThread () try { ImapUtils.ParseThreads (engine, 0, threads, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing THREAD response failed: {0}", ex); + Assert.Fail ($"Parsing THREAD response failed: {ex}"); return; } @@ -3666,7 +3666,7 @@ public async Task TestParseLongDovecotExampleThreadAsync () try { await ImapUtils.ParseThreadsAsync (engine, 0, threads, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing THREAD response failed: {0}", ex); + Assert.Fail ($"Parsing THREAD response failed: {ex}"); return; } @@ -3702,7 +3702,7 @@ public void TestParseShortDovecotExampleThread () try { ImapUtils.ParseThreads (engine, 0, threads, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing THREAD response failed: {0}", ex); + Assert.Fail ($"Parsing THREAD response failed: {ex}"); return; } @@ -3739,7 +3739,7 @@ public async Task TestParseShortDovecotExampleThreadAsync () try { await ImapUtils.ParseThreadsAsync (engine, 0, threads, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing THREAD response failed: {0}", ex); + Assert.Fail ($"Parsing THREAD response failed: {ex}"); return; } @@ -3801,7 +3801,7 @@ public void TestParseAnnotationsExample1 () try { annotations = ImapUtils.ParseAnnotationsAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing ANNOTATION response failed: {0}", ex); + Assert.Fail ($"Parsing ANNOTATION response failed: {ex}"); return; } @@ -3833,7 +3833,7 @@ public async Task TestParseAnnotationsExample1Async () try { annotations = await ImapUtils.ParseAnnotationsAsync (engine, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing ANNOTATION response failed: {0}", ex); + Assert.Fail ($"Parsing ANNOTATION response failed: {ex}"); return; } @@ -3865,7 +3865,7 @@ public void TestParseAnnotationsExample2 () try { annotations = ImapUtils.ParseAnnotationsAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing ANNOTATION response failed: {0}", ex); + Assert.Fail ($"Parsing ANNOTATION response failed: {ex}"); return; } @@ -3901,7 +3901,7 @@ public async Task TestParseAnnotationsExample2Async () try { annotations = await ImapUtils.ParseAnnotationsAsync (engine, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing ANNOTATION response failed: {0}", ex); + Assert.Fail ($"Parsing ANNOTATION response failed: {ex}"); return; } @@ -3937,7 +3937,7 @@ public void TestParseAnnotationsExample3 () try { annotations = ImapUtils.ParseAnnotationsAsync (engine, false, CancellationToken.None).GetAwaiter ().GetResult (); } catch (Exception ex) { - Assert.Fail ("Parsing ANNOTATION response failed: {0}", ex); + Assert.Fail ($"Parsing ANNOTATION response failed: {ex}"); return; } @@ -3971,7 +3971,7 @@ public async Task TestParseAnnotationsExample3Async () try { annotations = await ImapUtils.ParseAnnotationsAsync (engine, true, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing ANNOTATION response failed: {0}", ex); + Assert.Fail ($"Parsing ANNOTATION response failed: {ex}"); return; } @@ -4012,7 +4012,7 @@ public void TestParseFolderListWithFolderNameContainingUnquotedTabs () try { ImapUtils.ParseFolderList (engine, list, false, false, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing LIST response failed: {0}", ex); + Assert.Fail ($"Parsing LIST response failed: {ex}"); return; } @@ -4042,7 +4042,7 @@ public async Task TestParseFolderListWithFolderNameContainingUnquotedTabsAsync ( try { await ImapUtils.ParseFolderListAsync (engine, list, false, false, CancellationToken.None); } catch (Exception ex) { - Assert.Fail ("Parsing LIST response failed: {0}", ex); + Assert.Fail ($"Parsing LIST response failed: {ex}"); return; } diff --git a/UnitTests/Net/Pop3/Pop3ClientTests.cs b/UnitTests/Net/Pop3/Pop3ClientTests.cs index 497fd9d338..88a3aa9c2b 100644 --- a/UnitTests/Net/Pop3/Pop3ClientTests.cs +++ b/UnitTests/Net/Pop3/Pop3ClientTests.cs @@ -235,7 +235,7 @@ public void TestSslHandshakeExceptions () if (ex.RootCertificateAuthority is X509Certificate2 root) SslHandshakeExceptionTests.AssertRootCertificate (root); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } try { @@ -250,7 +250,7 @@ public void TestSslHandshakeExceptions () if (ex.RootCertificateAuthority is X509Certificate2 root) SslHandshakeExceptionTests.AssertRootCertificate (root); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } } } @@ -279,7 +279,7 @@ public async Task TestSslHandshakeExceptionsAsync () if (ex.RootCertificateAuthority is X509Certificate2 root) SslHandshakeExceptionTests.AssertRootCertificate (root); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } try { @@ -294,7 +294,7 @@ public async Task TestSslHandshakeExceptionsAsync () if (ex.RootCertificateAuthority is X509Certificate2 root) SslHandshakeExceptionTests.AssertRootCertificate (root); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } } } @@ -353,7 +353,7 @@ public void TestInvalidStateExceptions () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -430,7 +430,7 @@ public void TestInvalidStateExceptions () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -483,7 +483,7 @@ public async Task TestInvalidStateExceptionsAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -560,7 +560,7 @@ public async Task TestInvalidStateExceptionsAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1123,7 +1123,7 @@ public void TestGreetingOk () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1137,7 +1137,7 @@ public void TestGreetingOk () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1157,7 +1157,7 @@ public async Task TestGreetingOkAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1171,7 +1171,7 @@ public async Task TestGreetingOkAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1192,7 +1192,7 @@ public void TestGreetingErr () } catch (Pop3ProtocolException) { Assert.Pass (); } catch (Exception ex) { - Assert.Fail ("Expected Pop3ProtocolException from Connect: {0}", ex); + Assert.Fail ($"Expected Pop3ProtocolException from Connect: {ex}"); } } } @@ -1211,7 +1211,7 @@ public async Task TestGreetingErrAsync () } catch (Pop3ProtocolException) { Assert.Pass (); } catch (Exception ex) { - Assert.Fail ("Expected Pop3ProtocolException from Connect: {0}", ex); + Assert.Fail ($"Expected Pop3ProtocolException from Connect: {ex}"); } } } @@ -1242,7 +1242,7 @@ public void TestBasicPop3Client () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1257,7 +1257,7 @@ public void TestBasicPop3Client () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ComcastCapa2, client.Capabilities); @@ -1276,14 +1276,14 @@ public void TestBasicPop3Client () for (int i = 0; i < sizes.Count; i++) Assert.AreEqual ((i + 1) * 1024, sizes[i], "Unexpected size for message #{0}", i); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageSizes: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageSizes: {ex}"); } try { var size = client.GetMessageSize (0); Assert.AreEqual (1024, size, "Unexpected size for 1st message"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageSizes: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageSizes: {ex}"); } try { @@ -1291,20 +1291,20 @@ public void TestBasicPop3Client () // TODO: assert that the message is byte-identical to what we expect } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessage: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessage: {ex}"); } try { var count = client.GetMessageCount (); Assert.AreEqual (7, count, "Expected 7 messages again"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageCount: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageCount: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1320,7 +1320,7 @@ public async Task TestBasicPop3ClientAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1335,7 +1335,7 @@ public async Task TestBasicPop3ClientAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ComcastCapa2, client.Capabilities); @@ -1354,14 +1354,14 @@ public async Task TestBasicPop3ClientAsync () for (int i = 0; i < sizes.Count; i++) Assert.AreEqual ((i + 1) * 1024, sizes[i], "Unexpected size for message #{0}", i); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageSizes: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageSizes: {ex}"); } try { var size = await client.GetMessageSizeAsync (0); Assert.AreEqual (1024, size, "Unexpected size for 1st message"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageSizes: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageSizes: {ex}"); } try { @@ -1369,20 +1369,20 @@ public async Task TestBasicPop3ClientAsync () // TODO: assert that the message is byte-identical to what we expect } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessage: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessage: {ex}"); } try { var count = await client.GetMessageCountAsync (); Assert.AreEqual (7, count, "Expected 7 messages again"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageCount: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageCount: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1398,7 +1398,7 @@ public void TestBasicPop3ClientUnixLineEndings () try { client.Connect (new Pop3ReplayStream (commands, false, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1410,7 +1410,7 @@ public void TestBasicPop3ClientUnixLineEndings () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ComcastCapa2, client.Capabilities); @@ -1429,14 +1429,14 @@ public void TestBasicPop3ClientUnixLineEndings () for (int i = 0; i < sizes.Count; i++) Assert.AreEqual ((i + 1) * 1024, sizes[i], "Unexpected size for message #{0}", i); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageSizes: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageSizes: {ex}"); } try { var size = client.GetMessageSize (0); Assert.AreEqual (1024, size, "Unexpected size for 1st message"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageSizes: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageSizes: {ex}"); } try { @@ -1444,20 +1444,20 @@ public void TestBasicPop3ClientUnixLineEndings () // TODO: assert that the message is byte-identical to what we expect } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessage: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessage: {ex}"); } try { var count = client.GetMessageCount (); Assert.AreEqual (7, count, "Expected 7 messages again"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageCount: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageCount: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1473,7 +1473,7 @@ public async Task TestBasicPop3ClientUnixLineEndingsAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1485,7 +1485,7 @@ public async Task TestBasicPop3ClientUnixLineEndingsAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ComcastCapa2, client.Capabilities); @@ -1504,14 +1504,14 @@ public async Task TestBasicPop3ClientUnixLineEndingsAsync () for (int i = 0; i < sizes.Count; i++) Assert.AreEqual ((i + 1) * 1024, sizes[i], "Unexpected size for message #{0}", i); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageSizes: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageSizes: {ex}"); } try { var size = await client.GetMessageSizeAsync (0); Assert.AreEqual (1024, size, "Unexpected size for 1st message"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageSizes: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageSizes: {ex}"); } try { @@ -1519,20 +1519,20 @@ public async Task TestBasicPop3ClientUnixLineEndingsAsync () // TODO: assert that the message is byte-identical to what we expect } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessage: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessage: {ex}"); } try { var count = await client.GetMessageCountAsync (); Assert.AreEqual (7, count, "Expected 7 messages again"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageCount: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageCount: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1558,7 +1558,7 @@ public void TestProbedUidlSupport () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1570,7 +1570,7 @@ public void TestProbedUidlSupport () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (Pop3Capabilities.User | Pop3Capabilities.UIDL, client.Capabilities); @@ -1585,7 +1585,7 @@ public void TestProbedUidlSupport () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1611,7 +1611,7 @@ public async Task TestProbedUidlSupportAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1623,7 +1623,7 @@ public async Task TestProbedUidlSupportAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (Pop3Capabilities.User | Pop3Capabilities.UIDL, client.Capabilities); @@ -1638,7 +1638,7 @@ public async Task TestProbedUidlSupportAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1663,7 +1663,7 @@ public void TestProbedUidlSupportError () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1675,7 +1675,7 @@ public void TestProbedUidlSupportError () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (Pop3Capabilities.User, client.Capabilities); @@ -1691,7 +1691,7 @@ public void TestProbedUidlSupportError () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1716,7 +1716,7 @@ public async Task TestProbedUidlSupportErrorAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1728,7 +1728,7 @@ public async Task TestProbedUidlSupportErrorAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (Pop3Capabilities.User, client.Capabilities); @@ -1744,7 +1744,7 @@ public async Task TestProbedUidlSupportErrorAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1766,7 +1766,7 @@ public void TestEnableUTF8 () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1779,20 +1779,20 @@ public void TestEnableUTF8 () try { client.EnableUTF8 (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in EnableUTF8: {0}", ex); + Assert.Fail ($"Did not expect an exception in EnableUTF8: {ex}"); } // Try to enable UTF8 again even though we've done it. This should just no-op and not send another command. try { client.EnableUTF8 (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception from second call to EnableUTF8: {0}", ex); + Assert.Fail ($"Did not expect an exception from second call to EnableUTF8: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1815,7 +1815,7 @@ public async Task TestEnableUTF8Async () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1828,20 +1828,20 @@ public async Task TestEnableUTF8Async () try { await client.EnableUTF8Async (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in EnableUTF8: {0}", ex); + Assert.Fail ($"Did not expect an exception in EnableUTF8: {ex}"); } // Try to enable UTF8 again even though we've done it. This should just no-op and not send another command. try { await client.EnableUTF8Async (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception from second call to EnableUTF8: {0}", ex); + Assert.Fail ($"Did not expect an exception from second call to EnableUTF8: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1866,7 +1866,7 @@ public void TestEnableUTF8AfterAuthenticate () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1879,7 +1879,7 @@ public void TestEnableUTF8AfterAuthenticate () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (LangCapa1, client.Capabilities); @@ -1892,13 +1892,13 @@ public void TestEnableUTF8AfterAuthenticate () } catch (InvalidOperationException) { Assert.Pass (); } catch (Exception ex) { - Assert.Fail ("Unexpected exception thrown by EnableUTF8: {0}", ex); + Assert.Fail ($"Unexpected exception thrown by EnableUTF8: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1923,7 +1923,7 @@ public async Task TestEnableUTF8AfterAuthenticateAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1936,7 +1936,7 @@ public async Task TestEnableUTF8AfterAuthenticateAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (LangCapa1, client.Capabilities); @@ -1949,13 +1949,13 @@ public async Task TestEnableUTF8AfterAuthenticateAsync () } catch (InvalidOperationException) { Assert.Pass (); } catch (Exception ex) { - Assert.Fail ("Unexpected exception thrown by EnableUTF8Async: {0}", ex); + Assert.Fail ($"Unexpected exception thrown by EnableUTF8Async: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1977,7 +1977,7 @@ public void TestEnableUTF8NotSupported () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1993,13 +1993,13 @@ public void TestEnableUTF8NotSupported () } catch (NotSupportedException) { Assert.Pass (); } catch (Exception ex) { - Assert.Fail ("Unexpected exception thrown by EnableUTF8: {0}", ex); + Assert.Fail ($"Unexpected exception thrown by EnableUTF8: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2021,7 +2021,7 @@ public async Task TestEnableUTF8NotSupportedAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2037,13 +2037,13 @@ public async Task TestEnableUTF8NotSupportedAsync () } catch (NotSupportedException) { Assert.Pass (); } catch (Exception ex) { - Assert.Fail ("Unexpected exception thrown by EnableUTF8Async: {0}", ex); + Assert.Fail ($"Unexpected exception thrown by EnableUTF8Async: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2071,7 +2071,7 @@ public void TestGetMessageCountParseExceptions () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2083,7 +2083,7 @@ public void TestGetMessageCountParseExceptions () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ComcastCapa2, client.Capabilities); @@ -2108,7 +2108,7 @@ public void TestGetMessageCountParseExceptions () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2135,7 +2135,7 @@ public async Task TestGetMessageCountParseExceptionsAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2147,7 +2147,7 @@ public async Task TestGetMessageCountParseExceptionsAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ComcastCapa2, client.Capabilities); @@ -2172,7 +2172,7 @@ public async Task TestGetMessageCountParseExceptionsAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2199,7 +2199,7 @@ public void TestGetMessageSizeParseExceptions () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2211,7 +2211,7 @@ public void TestGetMessageSizeParseExceptions () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ComcastCapa2, client.Capabilities); @@ -2236,7 +2236,7 @@ public void TestGetMessageSizeParseExceptions () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2263,7 +2263,7 @@ public async Task TestGetMessageSizeParseExceptionsAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2275,7 +2275,7 @@ public async Task TestGetMessageSizeParseExceptionsAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ComcastCapa2, client.Capabilities); @@ -2300,7 +2300,7 @@ public async Task TestGetMessageSizeParseExceptionsAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2327,7 +2327,7 @@ public void TestGetMessageSizesParseExceptions () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2339,7 +2339,7 @@ public void TestGetMessageSizesParseExceptions () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ComcastCapa2, client.Capabilities); @@ -2364,7 +2364,7 @@ public void TestGetMessageSizesParseExceptions () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2391,7 +2391,7 @@ public async Task TestGetMessageSizesParseExceptionsAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2403,7 +2403,7 @@ public async Task TestGetMessageSizesParseExceptionsAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ComcastCapa2, client.Capabilities); @@ -2428,7 +2428,7 @@ public async Task TestGetMessageSizesParseExceptionsAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2454,7 +2454,7 @@ public void TestGetMessageUidParseExceptions () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2467,7 +2467,7 @@ public void TestGetMessageUidParseExceptions () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailCapa2, client.Capabilities); @@ -2485,7 +2485,7 @@ public void TestGetMessageUidParseExceptions () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2511,7 +2511,7 @@ public async Task TestGetMessageUidParseExceptionsAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2524,7 +2524,7 @@ public async Task TestGetMessageUidParseExceptionsAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailCapa2, client.Capabilities); @@ -2542,7 +2542,7 @@ public async Task TestGetMessageUidParseExceptionsAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2568,7 +2568,7 @@ public void TestGetMessageUidsParseExceptions () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2581,7 +2581,7 @@ public void TestGetMessageUidsParseExceptions () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailCapa2, client.Capabilities); @@ -2599,7 +2599,7 @@ public void TestGetMessageUidsParseExceptions () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2625,7 +2625,7 @@ public async Task TestGetMessageUidsParseExceptionsAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2638,7 +2638,7 @@ public async Task TestGetMessageUidsParseExceptionsAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailCapa2, client.Capabilities); @@ -2656,7 +2656,7 @@ public async Task TestGetMessageUidsParseExceptionsAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2681,7 +2681,7 @@ public void TestSaslAuthentication () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2699,7 +2699,7 @@ public void TestSaslAuthentication () client.Authenticate (sasl); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ExchangeCapa, client.Capabilities); @@ -2715,7 +2715,7 @@ public void TestSaslAuthentication () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2740,7 +2740,7 @@ public async Task TestSaslAuthenticationAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2758,7 +2758,7 @@ public async Task TestSaslAuthenticationAsync () await client.AuthenticateAsync (sasl); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ExchangeCapa, client.Capabilities); @@ -2774,7 +2774,7 @@ public async Task TestSaslAuthenticationAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2843,7 +2843,7 @@ public void TestRedactApop () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2856,13 +2856,13 @@ public void TestRedactApop () try { client.EnableUTF8 (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in EnableUTF8: {0}", ex); + Assert.Fail ($"Did not expect an exception in EnableUTF8: {ex}"); } try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (LangCapa2, client.Capabilities); @@ -2874,7 +2874,7 @@ public void TestRedactApop () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2902,7 +2902,7 @@ public async Task TestRedactApopAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2915,13 +2915,13 @@ public async Task TestRedactApopAsync () try { await client.EnableUTF8Async (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in EnableUTF8: {0}", ex); + Assert.Fail ($"Did not expect an exception in EnableUTF8: {ex}"); } try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (LangCapa2, client.Capabilities); @@ -2933,7 +2933,7 @@ public async Task TestRedactApopAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2962,7 +2962,7 @@ public void TestRedactAuthentication () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2981,7 +2981,7 @@ public void TestRedactAuthentication () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ExchangeCapa, client.Capabilities); @@ -2997,7 +2997,7 @@ public void TestRedactAuthentication () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3026,7 +3026,7 @@ public async Task TestRedactAuthenticationAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3045,7 +3045,7 @@ public async Task TestRedactAuthenticationAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ExchangeCapa, client.Capabilities); @@ -3061,7 +3061,7 @@ public async Task TestRedactAuthenticationAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3089,7 +3089,7 @@ public void TestRedactUserPass () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3101,7 +3101,7 @@ public void TestRedactUserPass () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ComcastCapa2, client.Capabilities); @@ -3117,7 +3117,7 @@ public void TestRedactUserPass () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3146,7 +3146,7 @@ public async Task TestRedactUserPassAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3158,7 +3158,7 @@ public async Task TestRedactUserPassAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ComcastCapa2, client.Capabilities); @@ -3174,7 +3174,7 @@ public async Task TestRedactUserPassAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3204,7 +3204,7 @@ public void TestRedactSaslAuthentication () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3222,7 +3222,7 @@ public void TestRedactSaslAuthentication () client.Authenticate (sasl); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ExchangeCapa, client.Capabilities); @@ -3238,7 +3238,7 @@ public void TestRedactSaslAuthentication () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3267,7 +3267,7 @@ public async Task TestRedactSaslAuthenticationAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3285,7 +3285,7 @@ public async Task TestRedactSaslAuthenticationAsync () await client.AuthenticateAsync (sasl); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ExchangeCapa, client.Capabilities); @@ -3301,7 +3301,7 @@ public async Task TestRedactSaslAuthenticationAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3331,7 +3331,7 @@ public void TestExchangePop3Client () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3351,7 +3351,7 @@ public void TestExchangePop3Client () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ExchangeCapa, client.Capabilities); @@ -3368,7 +3368,7 @@ public void TestExchangePop3Client () var uids = client.GetMessageUids (); Assert.AreEqual (7, uids.Count, "Expected 7 uids"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageUids: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageUids: {ex}"); } try { @@ -3376,13 +3376,13 @@ public void TestExchangePop3Client () // TODO: assert that the message is byte-identical to what we expect } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessage: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessage: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3409,7 +3409,7 @@ public async Task TestExchangePop3ClientAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3429,7 +3429,7 @@ public async Task TestExchangePop3ClientAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (ExchangeCapa, client.Capabilities); @@ -3446,7 +3446,7 @@ public async Task TestExchangePop3ClientAsync () var uids = await client.GetMessageUidsAsync (); Assert.AreEqual (7, uids.Count, "Expected 7 uids"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageUids: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageUids: {ex}"); } try { @@ -3454,13 +3454,13 @@ public async Task TestExchangePop3ClientAsync () // TODO: assert that the message is byte-identical to what we expect } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessage: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessage: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3514,7 +3514,7 @@ void TestGMailPop3Client (List commands, bool disablePipelini try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3527,7 +3527,7 @@ void TestGMailPop3Client (List commands, bool disablePipelini try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailCapa2, client.Capabilities); @@ -3578,7 +3578,7 @@ void TestGMailPop3Client (List commands, bool disablePipelini } } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessage: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessage: {ex}"); } try { @@ -3601,7 +3601,7 @@ void TestGMailPop3Client (List commands, bool disablePipelini message.Dispose (); } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessages: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessages: {ex}"); } try { @@ -3624,7 +3624,7 @@ void TestGMailPop3Client (List commands, bool disablePipelini message.Dispose (); } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessages: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessages: {ex}"); } try { @@ -3632,7 +3632,7 @@ void TestGMailPop3Client (List commands, bool disablePipelini Assert.AreEqual ("Test inline image", header[HeaderId.Subject]); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageHeaders: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageHeaders: {ex}"); } try { @@ -3642,7 +3642,7 @@ void TestGMailPop3Client (List commands, bool disablePipelini for (int i = 0; i < headers.Count; i++) Assert.AreEqual ("Test inline image", headers[i][HeaderId.Subject]); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageHeaders: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageHeaders: {ex}"); } try { @@ -3652,14 +3652,14 @@ void TestGMailPop3Client (List commands, bool disablePipelini for (int i = 0; i < headers.Count; i++) Assert.AreEqual ("Test inline image", headers[i][HeaderId.Subject]); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageHeaders: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageHeaders: {ex}"); } try { using (var stream = client.GetStream (0)) { } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetStream: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetStream: {ex}"); } try { @@ -3670,7 +3670,7 @@ void TestGMailPop3Client (List commands, bool disablePipelini streams[i].Dispose (); } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetStreams: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetStreams: {ex}"); } try { @@ -3681,67 +3681,67 @@ void TestGMailPop3Client (List commands, bool disablePipelini streams[i].Dispose (); } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetStreams: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetStreams: {ex}"); } try { client.NoOp (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in NoOp: {0}", ex); + Assert.Fail ($"Did not expect an exception in NoOp: {ex}"); } try { client.DeleteMessage (0); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in DeleteMessage: {0}", ex); + Assert.Fail ($"Did not expect an exception in DeleteMessage: {ex}"); } try { client.Reset (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Reset: {0}", ex); + Assert.Fail ($"Did not expect an exception in Reset: {ex}"); } try { client.DeleteMessages (new [] { 0, 1, 2 }); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in DeleteMessages: {0}", ex); + Assert.Fail ($"Did not expect an exception in DeleteMessages: {ex}"); } try { client.Reset (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Reset: {0}", ex); + Assert.Fail ($"Did not expect an exception in Reset: {ex}"); } try { client.DeleteMessages (0, 3); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in DeleteMessages: {0}", ex); + Assert.Fail ($"Did not expect an exception in DeleteMessages: {ex}"); } try { client.Reset (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Reset: {0}", ex); + Assert.Fail ($"Did not expect an exception in Reset: {ex}"); } try { client.DeleteAllMessages (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in DeleteAllMessages: {0}", ex); + Assert.Fail ($"Did not expect an exception in DeleteAllMessages: {ex}"); } try { client.Reset (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Reset: {0}", ex); + Assert.Fail ($"Did not expect an exception in Reset: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3760,7 +3760,7 @@ async Task TestGMailPop3ClientAsync (List commands, bool disa try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3773,7 +3773,7 @@ async Task TestGMailPop3ClientAsync (List commands, bool disa try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailCapa2, client.Capabilities); @@ -3824,7 +3824,7 @@ async Task TestGMailPop3ClientAsync (List commands, bool disa } } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessage: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessage: {ex}"); } try { @@ -3847,7 +3847,7 @@ async Task TestGMailPop3ClientAsync (List commands, bool disa message.Dispose (); } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessages: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessages: {ex}"); } try { @@ -3870,7 +3870,7 @@ async Task TestGMailPop3ClientAsync (List commands, bool disa message.Dispose (); } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessages: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessages: {ex}"); } try { @@ -3878,7 +3878,7 @@ async Task TestGMailPop3ClientAsync (List commands, bool disa Assert.AreEqual ("Test inline image", header[HeaderId.Subject]); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageHeaders: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageHeaders: {ex}"); } try { @@ -3888,7 +3888,7 @@ async Task TestGMailPop3ClientAsync (List commands, bool disa for (int i = 0; i < headers.Count; i++) Assert.AreEqual ("Test inline image", headers[i][HeaderId.Subject]); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageHeaders: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageHeaders: {ex}"); } try { @@ -3898,14 +3898,14 @@ async Task TestGMailPop3ClientAsync (List commands, bool disa for (int i = 0; i < headers.Count; i++) Assert.AreEqual ("Test inline image", headers[i][HeaderId.Subject]); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetMessageHeaders: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetMessageHeaders: {ex}"); } try { using (var stream = await client.GetStreamAsync (0)) { } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetStream: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetStream: {ex}"); } try { @@ -3916,7 +3916,7 @@ async Task TestGMailPop3ClientAsync (List commands, bool disa streams[i].Dispose (); } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetStreams: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetStreams: {ex}"); } try { @@ -3927,67 +3927,67 @@ async Task TestGMailPop3ClientAsync (List commands, bool disa streams[i].Dispose (); } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in GetStreams: {0}", ex); + Assert.Fail ($"Did not expect an exception in GetStreams: {ex}"); } try { await client.NoOpAsync (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in NoOp: {0}", ex); + Assert.Fail ($"Did not expect an exception in NoOp: {ex}"); } try { await client.DeleteMessageAsync (0); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in DeleteMessage: {0}", ex); + Assert.Fail ($"Did not expect an exception in DeleteMessage: {ex}"); } try { await client.ResetAsync (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Reset: {0}", ex); + Assert.Fail ($"Did not expect an exception in Reset: {ex}"); } try { await client.DeleteMessagesAsync (new [] { 0, 1, 2 }); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in DeleteMessages: {0}", ex); + Assert.Fail ($"Did not expect an exception in DeleteMessages: {ex}"); } try { await client.ResetAsync (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Reset: {0}", ex); + Assert.Fail ($"Did not expect an exception in Reset: {ex}"); } try { await client.DeleteMessagesAsync (0, 3); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in DeleteMessages: {0}", ex); + Assert.Fail ($"Did not expect an exception in DeleteMessages: {ex}"); } try { await client.ResetAsync (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Reset: {0}", ex); + Assert.Fail ($"Did not expect an exception in Reset: {ex}"); } try { await client.DeleteAllMessagesAsync (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in DeleteAllMessages: {0}", ex); + Assert.Fail ($"Did not expect an exception in DeleteAllMessages: {ex}"); } try { await client.ResetAsync (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Reset: {0}", ex); + Assert.Fail ($"Did not expect an exception in Reset: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -4094,7 +4094,7 @@ public void TestGetEnumerator () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -4107,7 +4107,7 @@ public void TestGetEnumerator () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailCapa2, client.Capabilities); @@ -4128,7 +4128,7 @@ public void TestGetEnumerator () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -4154,7 +4154,7 @@ public void TestLangExtension () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -4167,13 +4167,13 @@ public void TestLangExtension () try { client.EnableUTF8 (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in EnableUTF8: {0}", ex); + Assert.Fail ($"Did not expect an exception in EnableUTF8: {ex}"); } try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (LangCapa2, client.Capabilities); @@ -4202,7 +4202,7 @@ public void TestLangExtension () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -4228,7 +4228,7 @@ public async Task TestLangExtensionAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -4241,13 +4241,13 @@ public async Task TestLangExtensionAsync () try { await client.EnableUTF8Async (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in EnableUTF8: {0}", ex); + Assert.Fail ($"Did not expect an exception in EnableUTF8: {ex}"); } try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (LangCapa2, client.Capabilities); @@ -4276,7 +4276,7 @@ public async Task TestLangExtensionAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -4300,7 +4300,7 @@ public void TestLangNotSupported () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -4313,7 +4313,7 @@ public void TestLangNotSupported () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailCapa2, client.Capabilities); @@ -4330,7 +4330,7 @@ public void TestLangNotSupported () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -4356,7 +4356,7 @@ public void TestParseExceptions () try { client.Connect (new Pop3ReplayStream (commands, false), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -4369,7 +4369,7 @@ public void TestParseExceptions () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailCapa2, client.Capabilities); @@ -4383,7 +4383,7 @@ public void TestParseExceptions () } catch (Pop3ProtocolException pex) { Assert.IsInstanceOf (pex.InnerException); } catch (Exception ex) { - Assert.Fail ("Unexpected exception thrown by GetMessage: {0}", ex); + Assert.Fail ($"Unexpected exception thrown by GetMessage: {ex}"); } try { @@ -4392,13 +4392,13 @@ public void TestParseExceptions () } catch (Pop3ProtocolException pex) { Assert.IsInstanceOf (pex.InnerException); } catch (Exception ex) { - Assert.Fail ("Unexpected exception thrown by GetMessageHeaders: {0}", ex); + Assert.Fail ($"Unexpected exception thrown by GetMessageHeaders: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -4424,7 +4424,7 @@ public async Task TestParseExceptionsAsync () try { await client.ConnectAsync (new Pop3ReplayStream (commands, true), "localhost", 110, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -4437,7 +4437,7 @@ public async Task TestParseExceptionsAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.AreEqual (GMailCapa2, client.Capabilities); @@ -4451,7 +4451,7 @@ public async Task TestParseExceptionsAsync () } catch (Pop3ProtocolException pex) { Assert.IsInstanceOf (pex.InnerException); } catch (Exception ex) { - Assert.Fail ("Unexpected exception thrown by GetMessageAsync: {0}", ex); + Assert.Fail ($"Unexpected exception thrown by GetMessageAsync: {ex}"); } try { @@ -4460,13 +4460,13 @@ public async Task TestParseExceptionsAsync () } catch (Pop3ProtocolException pex) { Assert.IsInstanceOf (pex.InnerException); } catch (Exception ex) { - Assert.Fail ("Unexpected exception thrown by GetMessageHeadersAsync: {0}", ex); + Assert.Fail ($"Unexpected exception thrown by GetMessageHeadersAsync: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); diff --git a/UnitTests/Net/Smtp/SmtpClientTests.cs b/UnitTests/Net/Smtp/SmtpClientTests.cs index 0f9863f320..75f4a3443a 100644 --- a/UnitTests/Net/Smtp/SmtpClientTests.cs +++ b/UnitTests/Net/Smtp/SmtpClientTests.cs @@ -320,7 +320,7 @@ public void TestSslHandshakeExceptions () if (ex.RootCertificateAuthority is X509Certificate2 root) SslHandshakeExceptionTests.AssertRootCertificate (root); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } try { @@ -335,7 +335,7 @@ public void TestSslHandshakeExceptions () if (ex.RootCertificateAuthority is X509Certificate2 root) SslHandshakeExceptionTests.AssertRootCertificate (root); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } } } @@ -364,7 +364,7 @@ public async Task TestSslHandshakeExceptionsAsync () if (ex.RootCertificateAuthority is X509Certificate2 root) SslHandshakeExceptionTests.AssertRootCertificate (root); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } try { @@ -379,7 +379,7 @@ public async Task TestSslHandshakeExceptionsAsync () if (ex.RootCertificateAuthority is X509Certificate2 root) SslHandshakeExceptionTests.AssertRootCertificate (root); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } } } @@ -407,7 +407,7 @@ public void TestLocalDomainIPv4 () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.Disconnect (true); @@ -429,7 +429,7 @@ public void TestLocalDomainIPv6 () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.Disconnect (true); @@ -451,7 +451,7 @@ public void TestLocalDomainIPv4MappedToIPv6 () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } client.Disconnect (true); @@ -476,7 +476,7 @@ public void TestSendWithoutSenderOrRecipients () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } using (var message = CreateSimpleMessage ()) { @@ -502,7 +502,7 @@ public async Task TestSendWithoutSenderOrRecipientsAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } using (var message = CreateSimpleMessage ()) { @@ -567,7 +567,7 @@ public void TestInvalidStateExceptions () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.Throws (() => client.Connect ("host", 465, SecureSocketOptions.SslOnConnect)); @@ -584,7 +584,7 @@ public void TestInvalidStateExceptions () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.Throws (() => client.Authenticate ("username", "password")); @@ -625,7 +625,7 @@ public async Task TestInvalidStateExceptionsAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.ThrowsAsync (async () => await client.ConnectAsync ("host", 465, SecureSocketOptions.SslOnConnect)); @@ -642,7 +642,7 @@ public async Task TestInvalidStateExceptionsAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.ThrowsAsync (async () => await client.AuthenticateAsync ("username", "password")); @@ -687,7 +687,7 @@ public void TestServiceNotReady () Assert.AreEqual (SmtpStatusCode.ServiceClosingTransmissionChannel, ex.StatusCode, "StatusCode"); Assert.AreEqual ("ESMTP server not ready", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception: {0}", ex); + Assert.Fail ($"Did not expect this exception: {ex}"); } } } @@ -708,7 +708,7 @@ public async Task TestServiceNotReadyAsync () Assert.AreEqual (SmtpStatusCode.ServiceClosingTransmissionChannel, ex.StatusCode, "StatusCode"); Assert.AreEqual ("ESMTP server not ready", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception: {0}", ex); + Assert.Fail ($"Did not expect this exception: {ex}"); } } } @@ -1257,7 +1257,7 @@ public void TestSaslInitialResponse () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1270,13 +1270,13 @@ public void TestSaslInitialResponse () try { client.Authenticate (new SaslMechanismPlain ("username", "password")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1299,7 +1299,7 @@ public async Task TestSaslInitialResponseAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1312,13 +1312,13 @@ public async Task TestSaslInitialResponseAsync () try { await client.AuthenticateAsync (new SaslMechanismPlain ("username", "password")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1350,7 +1350,7 @@ public void TestAuthenticationFailed () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1366,7 +1366,7 @@ public void TestAuthenticationFailed () } catch (AuthenticationException ex) { Assert.AreEqual ("535: authentication failed", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -1375,13 +1375,13 @@ public void TestAuthenticationFailed () } catch (AuthenticationException ex) { Assert.AreEqual ("535: authentication failed", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1399,7 +1399,7 @@ public async Task TestAuthenticationFailedAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1415,7 +1415,7 @@ public async Task TestAuthenticationFailedAsync () } catch (AuthenticationException ex) { Assert.AreEqual ("535: authentication failed", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -1424,13 +1424,13 @@ public async Task TestAuthenticationFailedAsync () } catch (AuthenticationException ex) { Assert.AreEqual ("535: authentication failed", ex.Message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1498,7 +1498,7 @@ public void TestRedactAuthentication () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1513,13 +1513,13 @@ public void TestRedactAuthentication () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1541,7 +1541,7 @@ public async Task TestRedactAuthenticationAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1556,13 +1556,13 @@ public async Task TestRedactAuthenticationAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1594,7 +1594,7 @@ public void TestRedactSaslInitialResponse () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1607,13 +1607,13 @@ public void TestRedactSaslInitialResponse () try { client.Authenticate (new SaslMechanismPlain ("username", "password")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1635,7 +1635,7 @@ public async Task TestRedactSaslInitialResponseAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1648,13 +1648,13 @@ public async Task TestRedactSaslInitialResponseAsync () try { await client.AuthenticateAsync (new SaslMechanismPlain ("username", "password")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1688,7 +1688,7 @@ public void TestRedactSaslAuthentication () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1701,13 +1701,13 @@ public void TestRedactSaslAuthentication () try { client.Authenticate (new SaslMechanismLogin ("username", "password")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1729,7 +1729,7 @@ public async Task TestRedactSaslAuthenticationAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1742,13 +1742,13 @@ public async Task TestRedactSaslAuthenticationAsync () try { await client.AuthenticateAsync (new SaslMechanismLogin ("username", "password")); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1774,7 +1774,7 @@ public void TestSmtpResponseModes (SmtpResponseMode mode) try { client.Connect (new SmtpReplayStream (commands, false, mode), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1796,7 +1796,7 @@ public void TestSmtpResponseModes (SmtpResponseMode mode) try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1824,7 +1824,7 @@ public void TestHeloFallback () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1834,7 +1834,7 @@ public void TestHeloFallback () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1852,7 +1852,7 @@ public async Task TestHeloFallbackAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1862,7 +1862,7 @@ public async Task TestHeloFallbackAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -1911,7 +1911,7 @@ public void TestBasicFunctionality () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -1941,7 +1941,7 @@ public void TestBasicFunctionality () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } MailboxAddress vrfy = null; @@ -1949,7 +1949,7 @@ public void TestBasicFunctionality () try { vrfy = client.Verify ("Smith"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Verify: {0}", ex); + Assert.Fail ($"Did not expect an exception in Verify: {ex}"); } Assert.NotNull (vrfy, "VRFY result"); @@ -1961,7 +1961,7 @@ public void TestBasicFunctionality () try { expn = client.Expand ("Example-People"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Expand: {0}", ex); + Assert.Fail ($"Did not expect an exception in Expand: {ex}"); } Assert.NotNull (expn, "EXPN result"); @@ -1983,7 +1983,7 @@ public void TestBasicFunctionality () try { client.NoOp (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in NoOp: {0}", ex); + Assert.Fail ($"Did not expect an exception in NoOp: {ex}"); } using (var message = CreateSimpleMessage ()) { @@ -1993,7 +1993,7 @@ public void TestBasicFunctionality () try { response = client.Send (message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); return; } @@ -2002,7 +2002,7 @@ public void TestBasicFunctionality () try { response = client.Send (message, message.From.Mailboxes.FirstOrDefault (), message.To.Mailboxes); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); return; } @@ -2011,7 +2011,7 @@ public void TestBasicFunctionality () try { response = client.Send (options, message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); return; } @@ -2020,7 +2020,7 @@ public void TestBasicFunctionality () try { response = client.Send (options, message, message.From.Mailboxes.FirstOrDefault (), message.To.Mailboxes); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); return; } @@ -2030,7 +2030,7 @@ public void TestBasicFunctionality () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2048,7 +2048,7 @@ public async Task TestBasicFunctionalityAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2078,7 +2078,7 @@ public async Task TestBasicFunctionalityAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } MailboxAddress vrfy = null; @@ -2086,7 +2086,7 @@ public async Task TestBasicFunctionalityAsync () try { vrfy = await client.VerifyAsync ("Smith"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Verify: {0}", ex); + Assert.Fail ($"Did not expect an exception in Verify: {ex}"); } Assert.NotNull (vrfy, "VRFY result"); @@ -2098,7 +2098,7 @@ public async Task TestBasicFunctionalityAsync () try { expn = await client.ExpandAsync ("Example-People"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Expand: {0}", ex); + Assert.Fail ($"Did not expect an exception in Expand: {ex}"); } Assert.NotNull (expn, "EXPN result"); @@ -2120,7 +2120,7 @@ public async Task TestBasicFunctionalityAsync () try { await client.NoOpAsync (); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in NoOp: {0}", ex); + Assert.Fail ($"Did not expect an exception in NoOp: {ex}"); } using (var message = CreateSimpleMessage ()) { @@ -2130,7 +2130,7 @@ public async Task TestBasicFunctionalityAsync () try { response = await client.SendAsync (message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); return; } @@ -2139,7 +2139,7 @@ public async Task TestBasicFunctionalityAsync () try { response = await client.SendAsync (message, message.From.Mailboxes.FirstOrDefault (), message.To.Mailboxes); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); return; } @@ -2148,7 +2148,7 @@ public async Task TestBasicFunctionalityAsync () try { response = await client.SendAsync (options, message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); return; } @@ -2157,7 +2157,7 @@ public async Task TestBasicFunctionalityAsync () try { response = await client.SendAsync (options, message, message.From.Mailboxes.FirstOrDefault (), message.To.Mailboxes); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); return; } @@ -2167,7 +2167,7 @@ public async Task TestBasicFunctionalityAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2197,7 +2197,7 @@ public void TestSaslAuthentication () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2227,13 +2227,13 @@ public void TestSaslAuthentication () client.Authenticate (sasl); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2251,7 +2251,7 @@ public async Task TestSaslAuthenticationAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2281,13 +2281,13 @@ public async Task TestSaslAuthenticationAsync () await client.AuthenticateAsync (sasl); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2317,7 +2317,7 @@ public void TestSaslExceptionProperlyResets () try { client.Connect (new SmtpReplayStream (commands, false), "elwood.innosoft.com", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2353,7 +2353,7 @@ public void TestSaslExceptionProperlyResets () } catch (AuthenticationException ax) { // yay! } catch (Exception ex) { - Assert.Fail ("Unexpected exception in Authenticate: {0}", ex); + Assert.Fail ($"Unexpected exception in Authenticate: {ex}"); } Assert.IsFalse (client.IsAuthenticated, "IsAuthenticated"); @@ -2361,7 +2361,7 @@ public void TestSaslExceptionProperlyResets () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2379,7 +2379,7 @@ public async Task TestSaslExceptionProperlyResetsAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "elwood.innosoft.com", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2415,7 +2415,7 @@ public async Task TestSaslExceptionProperlyResetsAsync () } catch (AuthenticationException ax) { // yay! } catch (Exception ex) { - Assert.Fail ("Unexpected exception in Authenticate: {0}", ex); + Assert.Fail ($"Unexpected exception in Authenticate: {ex}"); } Assert.IsFalse (client.IsAuthenticated, "IsAuthenticated"); @@ -2423,7 +2423,7 @@ public async Task TestSaslExceptionProperlyResetsAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2453,7 +2453,7 @@ public void TestEightBitMime () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2471,20 +2471,20 @@ public void TestEightBitMime () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { using (var message = CreateEightBitMessage ()) client.Send (message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2500,7 +2500,7 @@ public async Task TestEightBitMimeAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2518,20 +2518,20 @@ public async Task TestEightBitMimeAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { using (var message = CreateEightBitMessage ()) await client.SendAsync (message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2568,7 +2568,7 @@ public void TestInternationalMailboxes () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2587,14 +2587,14 @@ public void TestInternationalMailboxes () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } using (var message = CreateEightBitMessage ()) { try { client.Send (message, mailbox, new MailboxAddress[] { mailbox }); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); } // Disable SMTPUTF8 @@ -2603,14 +2603,14 @@ public void TestInternationalMailboxes () try { client.Send (message, mailbox, new MailboxAddress[] { mailbox }); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); } } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2626,7 +2626,7 @@ public async Task TestInternationalMailboxesAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2645,14 +2645,14 @@ public async Task TestInternationalMailboxesAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } using (var message = CreateEightBitMessage ()) { try { await client.SendAsync (message, mailbox, new MailboxAddress[] { mailbox }); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); } // Disable SMTPUTF8 @@ -2661,14 +2661,14 @@ public async Task TestInternationalMailboxesAsync () try { await client.SendAsync (message, mailbox, new MailboxAddress[] { mailbox }); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); } } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2725,7 +2725,7 @@ public void TestBinaryMime (bool showProgress) try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2743,7 +2743,7 @@ public void TestBinaryMime (bool showProgress) try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (SmtpCapabilities.BinaryMime), "Failed to detect BINARYMIME extension"); @@ -2760,13 +2760,13 @@ public void TestBinaryMime (bool showProgress) client.Send (message); } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2811,7 +2811,7 @@ public async Task TestBinaryMimeAsync (bool showProgress) try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2829,7 +2829,7 @@ public async Task TestBinaryMimeAsync (bool showProgress) try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } Assert.IsTrue (client.Capabilities.HasFlag (SmtpCapabilities.BinaryMime), "Failed to detect BINARYMIME extension"); @@ -2846,13 +2846,13 @@ public async Task TestBinaryMimeAsync (bool showProgress) await client.SendAsync (message); } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2883,7 +2883,7 @@ public void TestPipelining (bool showProgress) try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2902,7 +2902,7 @@ public void TestPipelining (bool showProgress) try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -2918,13 +2918,13 @@ public void TestPipelining (bool showProgress) } } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -2941,7 +2941,7 @@ public async Task TestPipeliningAsync (bool showProgress) try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -2960,7 +2960,7 @@ public async Task TestPipeliningAsync (bool showProgress) try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -2976,13 +2976,13 @@ public async Task TestPipeliningAsync (bool showProgress) } } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3010,7 +3010,7 @@ public void TestMailFromMailboxUnavailable () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3028,7 +3028,7 @@ public void TestMailFromMailboxUnavailable () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -3038,7 +3038,7 @@ public void TestMailFromMailboxUnavailable () } catch (SmtpCommandException sex) { Assert.AreEqual (sex.ErrorCode, SmtpErrorCode.SenderNotAccepted, "Unexpected SmtpErrorCode"); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Send: {0}", ex); + Assert.Fail ($"Did not expect this exception in Send: {ex}"); } Assert.IsTrue (client.IsConnected, "Expected the client to still be connected"); @@ -3046,7 +3046,7 @@ public void TestMailFromMailboxUnavailable () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3062,7 +3062,7 @@ public async Task TestMailFromMailboxUnavailableAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3080,7 +3080,7 @@ public async Task TestMailFromMailboxUnavailableAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -3090,7 +3090,7 @@ public async Task TestMailFromMailboxUnavailableAsync () } catch (SmtpCommandException sex) { Assert.AreEqual (sex.ErrorCode, SmtpErrorCode.SenderNotAccepted, "Unexpected SmtpErrorCode"); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Send: {0}", ex); + Assert.Fail ($"Did not expect this exception in Send: {ex}"); } Assert.IsTrue (client.IsConnected, "Expected the client to still be connected"); @@ -3098,7 +3098,7 @@ public async Task TestMailFromMailboxUnavailableAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3127,7 +3127,7 @@ public void TestRcptToMailboxUnavailable () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3145,7 +3145,7 @@ public void TestRcptToMailboxUnavailable () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -3155,7 +3155,7 @@ public void TestRcptToMailboxUnavailable () } catch (SmtpCommandException sex) { Assert.AreEqual (sex.ErrorCode, SmtpErrorCode.RecipientNotAccepted, "Unexpected SmtpErrorCode"); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Send: {0}", ex); + Assert.Fail ($"Did not expect this exception in Send: {ex}"); } Assert.IsTrue (client.IsConnected, "Expected the client to still be connected"); @@ -3163,7 +3163,7 @@ public void TestRcptToMailboxUnavailable () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3179,7 +3179,7 @@ public async Task TestRcptToMailboxUnavailableAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3197,7 +3197,7 @@ public async Task TestRcptToMailboxUnavailableAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -3207,7 +3207,7 @@ public async Task TestRcptToMailboxUnavailableAsync () } catch (SmtpCommandException sex) { Assert.AreEqual (sex.ErrorCode, SmtpErrorCode.RecipientNotAccepted, "Unexpected SmtpErrorCode"); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Send: {0}", ex); + Assert.Fail ($"Did not expect this exception in Send: {ex}"); } Assert.IsTrue (client.IsConnected, "Expected the client to still be connected"); @@ -3215,7 +3215,7 @@ public async Task TestRcptToMailboxUnavailableAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3261,7 +3261,7 @@ public void TestNoRecipientsAccepted () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3279,7 +3279,7 @@ public void TestNoRecipientsAccepted () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -3290,7 +3290,7 @@ public void TestNoRecipientsAccepted () Assert.AreEqual (sex.ErrorCode, SmtpErrorCode.MessageNotAccepted, "Unexpected SmtpErrorCode"); Assert.AreEqual (sex.StatusCode, SmtpStatusCode.TransactionFailed, "Unexpected SmtpStatusCode"); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Send: {0}", ex); + Assert.Fail ($"Did not expect this exception in Send: {ex}"); } Assert.AreEqual (1, client.NotAccepted, "NotAccepted"); @@ -3301,7 +3301,7 @@ public void TestNoRecipientsAccepted () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3317,7 +3317,7 @@ public async Task TestNoRecipientsAcceptedAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3335,7 +3335,7 @@ public async Task TestNoRecipientsAcceptedAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -3346,7 +3346,7 @@ public async Task TestNoRecipientsAcceptedAsync () Assert.AreEqual (sex.ErrorCode, SmtpErrorCode.MessageNotAccepted, "Unexpected SmtpErrorCode"); Assert.AreEqual (sex.StatusCode, SmtpStatusCode.TransactionFailed, "Unexpected SmtpStatusCode"); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Send: {0}", ex); + Assert.Fail ($"Did not expect this exception in Send: {ex}"); } Assert.AreEqual (1, client.NotAccepted, "NotAccepted"); @@ -3357,7 +3357,7 @@ public async Task TestNoRecipientsAcceptedAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3385,7 +3385,7 @@ public void TestNoRecipientsAcceptedPipelined () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3403,7 +3403,7 @@ public void TestNoRecipientsAcceptedPipelined () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -3414,7 +3414,7 @@ public void TestNoRecipientsAcceptedPipelined () Assert.AreEqual (SmtpErrorCode.MessageNotAccepted, sex.ErrorCode, "Unexpected SmtpErrorCode"); Assert.AreEqual (SmtpStatusCode.TransactionFailed, sex.StatusCode, "Unexpected SmtpStatusCode"); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Send: {0}", ex); + Assert.Fail ($"Did not expect this exception in Send: {ex}"); } Assert.AreEqual (1, client.NotAccepted, "NotAccepted"); @@ -3425,7 +3425,7 @@ public void TestNoRecipientsAcceptedPipelined () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3441,7 +3441,7 @@ public async Task TestNoRecipientsAcceptedPipelinedAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3459,7 +3459,7 @@ public async Task TestNoRecipientsAcceptedPipelinedAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } try { @@ -3470,7 +3470,7 @@ public async Task TestNoRecipientsAcceptedPipelinedAsync () Assert.AreEqual (sex.ErrorCode, SmtpErrorCode.MessageNotAccepted, "Unexpected SmtpErrorCode"); Assert.AreEqual (sex.StatusCode, SmtpStatusCode.TransactionFailed, "Unexpected SmtpStatusCode"); } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Send: {0}", ex); + Assert.Fail ($"Did not expect this exception in Send: {ex}"); } Assert.AreEqual (1, client.NotAccepted, "NotAccepted"); @@ -3481,7 +3481,7 @@ public async Task TestNoRecipientsAcceptedPipelinedAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3508,7 +3508,7 @@ public void TestUnauthorizedAccessException () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3530,7 +3530,7 @@ public void TestUnauthorizedAccessException () } catch (ServiceNotAuthenticatedException) { // this is the expected exception } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Send: {0}", ex); + Assert.Fail ($"Did not expect this exception in Send: {ex}"); } Assert.IsTrue (client.IsConnected, "Expected the client to still be connected"); @@ -3538,7 +3538,7 @@ public void TestUnauthorizedAccessException () try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3554,7 +3554,7 @@ public async Task TestUnauthorizedAccessExceptionAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3576,7 +3576,7 @@ public async Task TestUnauthorizedAccessExceptionAsync () } catch (ServiceNotAuthenticatedException) { // this is the expected exception } catch (Exception ex) { - Assert.Fail ("Did not expect this exception in Send: {0}", ex); + Assert.Fail ($"Did not expect this exception in Send: {ex}"); } Assert.IsTrue (client.IsConnected, "Expected the client to still be connected"); @@ -3584,7 +3584,7 @@ public async Task TestUnauthorizedAccessExceptionAsync () try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3648,7 +3648,7 @@ public void TestDeliveryStatusNotification () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3668,7 +3668,7 @@ public void TestDeliveryStatusNotification () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } // disable pipelining @@ -3680,13 +3680,13 @@ public void TestDeliveryStatusNotification () try { client.Send (message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3706,7 +3706,7 @@ public async Task TestDeliveryStatusNotificationAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3726,7 +3726,7 @@ public async Task TestDeliveryStatusNotificationAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } // disable pipelining @@ -3738,13 +3738,13 @@ public async Task TestDeliveryStatusNotificationAsync () try { await client.SendAsync (message); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3775,7 +3775,7 @@ public void TestDeliveryStatusNotificationWithHexEncode () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3795,7 +3795,7 @@ public void TestDeliveryStatusNotificationWithHexEncode () try { client.Authenticate ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } // disable pipelining @@ -3814,13 +3814,13 @@ public void TestDeliveryStatusNotificationWithHexEncode () client.Send (message); } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); } try { client.Disconnect (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3836,7 +3836,7 @@ public async Task TestDeliveryStatusNotificationWithHexEncodeAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3856,7 +3856,7 @@ public async Task TestDeliveryStatusNotificationWithHexEncodeAsync () try { await client.AuthenticateAsync ("username", "password"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Authenticate: {0}", ex); + Assert.Fail ($"Did not expect an exception in Authenticate: {ex}"); } // disable pipelining @@ -3875,13 +3875,13 @@ public async Task TestDeliveryStatusNotificationWithHexEncodeAsync () await client.SendAsync (message); } } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Send: {0}", ex); + Assert.Fail ($"Did not expect an exception in Send: {ex}"); } try { await client.DisconnectAsync (true); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Disconnect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Disconnect: {ex}"); } Assert.IsFalse (client.IsConnected, "Failed to disconnect"); @@ -3924,7 +3924,7 @@ public void TestCustomCommand () try { client.Connect (new SmtpReplayStream (commands, false), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -3955,7 +3955,7 @@ public void TestCustomCommand () try { response = client.SendCommand ("VRFY Smith"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Verify: {0}", ex); + Assert.Fail ($"Did not expect an exception in Verify: {ex}"); } Assert.NotNull (response, "VRFY result"); @@ -3965,7 +3965,7 @@ public void TestCustomCommand () try { response = client.SendCommand ("EXPN Example-People"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Expand: {0}", ex); + Assert.Fail ($"Did not expect an exception in Expand: {ex}"); } Assert.NotNull (response, "EXPN result"); @@ -3987,7 +3987,7 @@ public async Task TestCustomCommandAsync () try { await client.ConnectAsync (new SmtpReplayStream (commands, true), "localhost", 25, SecureSocketOptions.None); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Connect: {0}", ex); + Assert.Fail ($"Did not expect an exception in Connect: {ex}"); } Assert.IsTrue (client.IsConnected, "Client failed to connect."); @@ -4018,7 +4018,7 @@ public async Task TestCustomCommandAsync () try { response = await client.SendCommandAsync ("VRFY Smith"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Verify: {0}", ex); + Assert.Fail ($"Did not expect an exception in Verify: {ex}"); } Assert.NotNull (response, "VRFY result"); @@ -4028,7 +4028,7 @@ public async Task TestCustomCommandAsync () try { response = await client.SendCommandAsync ("EXPN Example-People"); } catch (Exception ex) { - Assert.Fail ("Did not expect an exception in Expand: {0}", ex); + Assert.Fail ($"Did not expect an exception in Expand: {ex}"); } Assert.NotNull (response, "EXPN result"); diff --git a/UnitTests/Security/SaslMechanismDigestMd5Tests.cs b/UnitTests/Security/SaslMechanismDigestMd5Tests.cs index 273804bd3b..bc1eee2015 100644 --- a/UnitTests/Security/SaslMechanismDigestMd5Tests.cs +++ b/UnitTests/Security/SaslMechanismDigestMd5Tests.cs @@ -106,7 +106,7 @@ static void AssertSaslException (SaslMechanismDigestMd5 sasl, string challenge, Assert.AreEqual (code, sex.ErrorCode, "ErrorCode"); return; } catch (Exception ex) { - Assert.Fail ("SaslException expected, but got: {0}", ex.GetType ().Name); + Assert.Fail ($"SaslException expected, but got: {ex.GetType ().Name}"); return; } diff --git a/UnitTests/Security/SaslMechanismScramSha1Tests.cs b/UnitTests/Security/SaslMechanismScramSha1Tests.cs index 8784fb03a3..5e6a478f9c 100644 --- a/UnitTests/Security/SaslMechanismScramSha1Tests.cs +++ b/UnitTests/Security/SaslMechanismScramSha1Tests.cs @@ -112,7 +112,7 @@ static void AssertSaslException (SaslMechanismScramSha1 sasl, string challenge, Assert.AreEqual (code, sex.ErrorCode, "ErrorCode"); return; } catch (Exception ex) { - Assert.Fail ("SaslException expected, but got: {0}", ex.GetType ().Name); + Assert.Fail ($"SaslException expected, but got: {ex.GetType ().Name}"); return; } diff --git a/UnitTests/Security/SaslMechanismScramSha256Tests.cs b/UnitTests/Security/SaslMechanismScramSha256Tests.cs index bcc517d53d..48685ae901 100644 --- a/UnitTests/Security/SaslMechanismScramSha256Tests.cs +++ b/UnitTests/Security/SaslMechanismScramSha256Tests.cs @@ -112,7 +112,7 @@ static void AssertSaslException (SaslMechanismScramSha256 sasl, string challenge Assert.AreEqual (code, sex.ErrorCode, "ErrorCode"); return; } catch (Exception ex) { - Assert.Fail ("SaslException expected, but got: {0}", ex.GetType ().Name); + Assert.Fail ($"SaslException expected, but got: {ex.GetType ().Name}"); return; } diff --git a/UnitTests/Security/SaslMechanismScramSha512Tests.cs b/UnitTests/Security/SaslMechanismScramSha512Tests.cs index 7a9865a7d2..dc26c50c33 100644 --- a/UnitTests/Security/SaslMechanismScramSha512Tests.cs +++ b/UnitTests/Security/SaslMechanismScramSha512Tests.cs @@ -112,7 +112,7 @@ static void AssertSaslException (SaslMechanismScramSha512 sasl, string challenge Assert.AreEqual (code, sex.ErrorCode, "ErrorCode"); return; } catch (Exception ex) { - Assert.Fail ("SaslException expected, but got: {0}", ex.GetType ().Name); + Assert.Fail ($"SaslException expected, but got: {ex.GetType ().Name}"); return; } diff --git a/UnitTests/Security/SaslMechanismTests.cs b/UnitTests/Security/SaslMechanismTests.cs index 262d4cda6e..17dc64a50a 100644 --- a/UnitTests/Security/SaslMechanismTests.cs +++ b/UnitTests/Security/SaslMechanismTests.cs @@ -104,7 +104,7 @@ public void TestSaslPrep () foreach (var c in prohibited) { try { SaslMechanism.SaslPrep (c.ToString ()); - Assert.Fail ("prohibited: '\\u{0:X}'", c); + Assert.Fail ($"prohibited: '\\u{c:X}'"); } catch (ArgumentException) { } } diff --git a/UnitTests/Security/SslHandshakeExceptionTests.cs b/UnitTests/Security/SslHandshakeExceptionTests.cs index d9f7cd94cd..9c05a4e704 100644 --- a/UnitTests/Security/SslHandshakeExceptionTests.cs +++ b/UnitTests/Security/SslHandshakeExceptionTests.cs @@ -343,7 +343,7 @@ public void TestSslCertificateValidationFailure () if (ex.RootCertificateAuthority is X509Certificate2 root) AssertRootCertificate (root); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } } } @@ -365,7 +365,7 @@ public async Task TestSslCertificateValidationFailureAsync () if (ex.RootCertificateAuthority is X509Certificate2 root) AssertRootCertificate (root); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } } } @@ -383,7 +383,7 @@ public void TestSslConnectOnPlainTextPortFailure () Assert.IsNull (ex.ServerCertificate, "ServerCertificate"); Assert.IsNull (ex.RootCertificateAuthority, "RootCertificateAuthority"); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } } } @@ -401,7 +401,7 @@ public async Task TestSslConnectOnPlainTextPortFailureAsync () Assert.IsNull (ex.ServerCertificate, "ServerCertificate"); Assert.IsNull (ex.RootCertificateAuthority, "RootCertificateAuthority"); } catch (Exception ex) { - Assert.Ignore ("SSL handshake failure inconclusive: {0}", ex); + Assert.Ignore ($"SSL handshake failure inconclusive: {ex}"); } } }