Пример #1
0
        public void TestIdle()
        {
            _settings.IMAPIdleEnabled = true;

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

             var oSimulator = new IMAPClientSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon(account.Address, "test");
             CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));

             oSimulator.StartIdle();

             if (oSimulator.GetPendingDataExists())
            throw new Exception("Unexpected data exists");

             // Send a message to this account.
             var oSMTP = new SMTPClientSimulator();
             oSMTP.Send(account.Address, account.Address, "IDLE Test", "This is a test of IDLE");

             string data;
             CustomAssert.IsTrue(oSimulator.EndIdle(false, out data));
        }
Пример #2
0
        public void TestConnectionObjectRelease()
        {
            TestSetup.DeleteCurrentDefaultLog();

             _settings.IMAPIdleEnabled = true;

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

             var simulator = new IMAPClientSimulator();

             string data;

             string sWelcomeMessage = simulator.Connect();
             simulator.Logon(account.Address, "test");
             CustomAssert.IsTrue(simulator.SelectFolder("INBOX"));
             CustomAssert.IsTrue(simulator.StartIdle());
             CustomAssert.IsTrue(simulator.EndIdle(true, out data));
             CustomAssert.IsTrue(simulator.Logout());

             string logData = TestSetup.ReadCurrentDefaultLog();

             CustomAssert.IsTrue(TestSetup.DefaultLogContains("Ending session"));
        }