public void TestConnectingToImapServerIncreasesImapSessionCount()
        {
            var app = SingletonProvider <TestSetup> .Instance.GetApp();

            var status      = app.Status;
            int countBefore = status.get_SessionCount(eSessionType.eSTIMAP);

            using (var conn1 = new TcpConnection())
            {
                Assert.IsTrue(conn1.Connect(143));
                CustomAsserts.AssertSessionCount(eSessionType.eSTIMAP, countBefore + 1);
            }
        }
        public void TestDisconnectingFromSmtpServerDecreasesIMAPPSmtpSessionCount()
        {
            var app = SingletonProvider <TestSetup> .Instance.GetApp();

            var status = app.Status;

            int countBefore = status.get_SessionCount(eSessionType.eSTSMTP);

            using (var conn1 = new TcpConnection())
            {
                Assert.IsTrue(conn1.Connect(25));
            }

            CustomAsserts.AssertSessionCount(eSessionType.eSTSMTP, countBefore);
        }
Esempio n. 3
0
        public void TestImproperDisconnect()
        {
            CustomAsserts.AssertSessionCount(eSessionType.eSTPOP3, 0);

            var application = SingletonProvider <TestSetup> .Instance.GetApp();

            var account = SingletonProvider <TestSetup> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            int iCount = application.Status.get_SessionCount(eSessionType.eSTPOP3);

            var pop3ClientSimulator = new Pop3ClientSimulator();

            pop3ClientSimulator.ConnectAndLogon(account.Address, "test");
            CustomAsserts.AssertSessionCount(eSessionType.eSTPOP3, iCount + 1);
            pop3ClientSimulator.Disconnect(); // Disconnect without sending quit

            CustomAsserts.AssertSessionCount(eSessionType.eSTPOP3, iCount);
        }