Ejemplo n.º 1
0
        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())
            {
                CustomAssert.IsTrue(conn1.Connect(143));
                TestSetup.AssertSessionCount(eSessionType.eSTIMAP, countBefore + 1);
            }
        }
Ejemplo n.º 2
0
        public void TestDisconnectingFromPop3ServerDecreasesPop3SessionCount()
        {
            var app = SingletonProvider <TestSetup> .Instance.GetApp();

            var status = app.Status;

            int countBefore;

            using (var conn1 = new TcpConnection())
            {
                CustomAssert.IsTrue(conn1.Connect(110));
                countBefore = status.get_SessionCount(eSessionType.eSTPOP3);
            }

            TestSetup.AssertSessionCount(eSessionType.eSTPOP3, countBefore - 1);
        }
Ejemplo n.º 3
0
        public void TestImproperDisconnect()
        {
            TestSetup.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 oPOP3 = new POP3ClientSimulator();

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

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