Beispiel #1
0
        public void TestChangeSeenFlag()
        {
            hMailServer.Account oAccount = SingletonProvider <Utilities> .Instance.AddAccount(_domain, "*****@*****.**", "test");

            Assert.IsTrue(SMTPClientSimulator.StaticSend("*****@*****.**", oAccount.Address, "Test", "test"));
            POP3Simulator.AssertMessageCount(oAccount.Address, "test", 1);

            IMAPSimulator simulator = new IMAPSimulator();

            simulator.ConnectAndLogon(oAccount.Address, "test");
            simulator.ExamineFolder("Inbox");
            string flags      = simulator.GetFlags(1);
            string body       = simulator.Fetch("1 RFC822");
            string flagsAfter = simulator.GetFlags(1);

            simulator.Close();
            simulator.Disconnect();

            Assert.AreEqual(flags, flagsAfter);

            IMAPSimulator secondSimulator = new IMAPSimulator();

            secondSimulator.ConnectAndLogon(oAccount.Address, "test");
            secondSimulator.SelectFolder("Inbox");
            string secondFlags      = secondSimulator.GetFlags(1);
            string secondBody       = secondSimulator.Fetch("1 RFC822");
            string secondFlagsAfter = secondSimulator.GetFlags(1);

            secondSimulator.Close();
            secondSimulator.Disconnect();

            Assert.AreNotEqual(secondFlags, secondFlagsAfter);
        }