public void TestLogoutInNonAuthenticatedState() { server.EnqueueResponse("* OK ImapSimulatedServer ready\r\n"); server.EnqueueResponse("* BYE Logging out\r\n" + "0000 OK logged out.\r\n"); using (var session = new ImapSession(host, port)) { Assert.IsTrue(session.Logout().Code == ImapCommandResultCode.Bye); Assert.AreEqual(ImapSessionState.NotConnected, session.State); Assert.AreEqual(null, session.Authority); } }